add: appimage config

This commit is contained in:
Kingtous
2022-05-29 10:14:22 +08:00
parent d1da63fc97
commit 0eeb0bacbd
5 changed files with 235 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ use hbb_common::{
};
#[cfg(any(target_os = "android", target_os = "ios", feature = "cli"))]
use hbb_common::{config::RENDEZVOUS_PORT, futures::future::join_all};
use std::sync::{Arc, Mutex};
use std::{sync::{Arc, Mutex}, path::Path};
pub const CLIPBOARD_NAME: &'static str = "clipboard";
pub const CLIPBOARD_INTERVAL: u64 = 333;
@@ -377,8 +377,10 @@ 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::current_exe()?;
return std::process::Command::new(cmd).args(&args).spawn();
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();
}
pub fn username() -> String {

View File

@@ -56,7 +56,10 @@ pub fn start(args: &mut [String]) {
macos::show_dock();
}
#[cfg(all(target_os = "linux", feature = "inline"))]
sciter::set_library("/usr/lib/rustdesk/libsciter-gtk.so").ok();
{
let prefix = std::env::var("APPDIR").unwrap_or("".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
// https://github.com/rustdesk/rustdesk/issues/132#issuecomment-886069737
#[cfg(windows)]