feat: appimage package script

revert: flutter lock file
This commit is contained in:
Kingtous
2022-06-09 17:30:26 +08:00
parent 0eeb0bacbd
commit 618be48726
10 changed files with 166 additions and 171 deletions

View File

@@ -377,10 +377,18 @@ pub fn get_time() -> i64 {
}
pub fn run_me<T: AsRef<std::ffi::OsStr>>(args: Vec<T>) -> std::io::Result<std::process::Child> {
let cmd = std::env::var("APPDIR").unwrap();
let p = Path::new(&cmd).join("AppRun");
log::info!("path: {:?}", p);
return std::process::Command::new(p).args(&args).spawn();
#[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").unwrap();
let appimage_cmd = Path::new(&appdir).join("AppRun");
log::info!("path: {:?}", appimage_cmd);
return std::process::Command::new(appimage_cmd).args(&args).spawn();
}
}
pub fn username() -> String {

View File

@@ -57,7 +57,10 @@ pub fn start(args: &mut [String]) {
}
#[cfg(all(target_os = "linux", feature = "inline"))]
{
#[cfg(feature = "appimage")]
let prefix = std::env::var("APPDIR").unwrap_or("".to_string());
#[cfg(not(feature = "appimage"))]
let prefix = "".to_string();
sciter::set_library(&(prefix + "/usr/lib/rustdesk/libsciter-gtk.so")).ok();
}
// https://github.com/c-smile/sciter-sdk/blob/master/include/sciter-x-types.h