mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-23 13:11:05 +03:00
plugin_framework, mid commit
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -100,10 +100,27 @@ pub fn init() {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[cfg(target_os = "windows")]
|
||||
fn get_share_dir() -> ResultType<PathBuf> {
|
||||
Ok(PathBuf::from(env::var("ProgramData")?))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[cfg(target_os = "linux")]
|
||||
fn get_share_dir() -> ResultType<PathBuf> {
|
||||
Ok(PathBuf::from("/usr/share"))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[cfg(target_os = "macos")]
|
||||
fn get_share_dir() -> ResultType<PathBuf> {
|
||||
Ok(PathBuf::from("/Library/Application Support"))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn get_plugins_dir() -> ResultType<PathBuf> {
|
||||
// to-do: linux and macos
|
||||
Ok(PathBuf::from(env::var("ProgramData")?)
|
||||
Ok(get_share_dir()?
|
||||
.join("RustDesk")
|
||||
.join(PLUGIN_SOURCE_LOCAL_DIR))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user