mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
fix appimage --cm
This commit is contained in:
@@ -844,18 +844,16 @@ pub fn refresh_rendezvous_server() {
|
||||
}
|
||||
|
||||
pub fn run_me<T: AsRef<std::ffi::OsStr>>(args: Vec<T>) -> std::io::Result<std::process::Child> {
|
||||
#[cfg(not(feature = "appimage"))]
|
||||
{
|
||||
let cmd = std::env::current_exe()?;
|
||||
return std::process::Command::new(cmd).args(&args).spawn();
|
||||
}
|
||||
#[cfg(feature = "appimage")]
|
||||
{
|
||||
let appdir = std::env::var("APPDIR").map_err(|_| std::io::ErrorKind::Other)?;
|
||||
#[cfg(target_os = "linux")]
|
||||
if let Ok(appdir) = std::env::var("APPDIR") {
|
||||
let appimage_cmd = std::path::Path::new(&appdir).join("AppRun");
|
||||
log::info!("path: {:?}", appimage_cmd);
|
||||
return std::process::Command::new(appimage_cmd).args(&args).spawn();
|
||||
if appimage_cmd.exists() {
|
||||
log::info!("path: {:?}", appimage_cmd);
|
||||
return std::process::Command::new(appimage_cmd).args(&args).spawn();
|
||||
}
|
||||
}
|
||||
let cmd = std::env::current_exe()?;
|
||||
return std::process::Command::new(cmd).args(&args).spawn();
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
||||
Reference in New Issue
Block a user