Skip to content

Commit

Permalink
fix appimage --cm
Browse files Browse the repository at this point in the history
  • Loading branch information
rustdesk committed May 2, 2024
1 parent 3c17d71 commit d18810b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
8 changes: 1 addition & 7 deletions appimage/AppImageBuilder-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,14 @@ script:
# desktop file
# - sed -i "s/Icon=\/usr\/share\/rustdesk\/files\/rustdesk.png/Icon=rustdesk/g" ./AppDir/usr/share/applications/rustdesk.desktop
- rm -rf ./AppDir/usr/share/applications
- touch ./AppDir/start.sh
- echo "#\!/bin/sh" >> ./AppDir/start.sh
- echo "echo \$APPIMAGE" >> ./AppDir/start.sh
- echo "echo \$ARGV0" >> ./AppDir/start.sh
- echo "exec usr/lib/rustdesk/rustdesk" >> ./AppDir/start.sh
- chmod +x ./AppDir/start.sh
AppDir:
path: ./AppDir
app_info:
id: rustdesk
name: rustdesk
icon: rustdesk
version: 1.2.4
exec: ./start.sh
exec: usr/lib/rustdesk/rustdesk
exec_args: $@
apt:
arch:
Expand Down
18 changes: 8 additions & 10 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit d18810b

Please sign in to comment.