fix appimage --cm
This commit is contained in:
parent
3c17d713b3
commit
d18810b612
@ -12,12 +12,6 @@ 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:
|
||||
@ -25,7 +19,7 @@ AppDir:
|
||||
name: rustdesk
|
||||
icon: rustdesk
|
||||
version: 1.2.4
|
||||
exec: ./start.sh
|
||||
exec: usr/lib/rustdesk/rustdesk
|
||||
exec_args: $@
|
||||
apt:
|
||||
arch:
|
||||
|
@ -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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user