plugin_framework, mid commit

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-05-11 16:54:57 +08:00
parent 095ac46255
commit 8e117b6dde
6 changed files with 115 additions and 46 deletions

View File

@@ -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))
}