mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-25 14:11:14 +03:00
fix: win, only start tray if is installed exe (#11737)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -78,13 +78,14 @@ pub fn core_main() -> Option<Vec<String>> {
|
||||
#[cfg(any(target_os = "linux", target_os = "windows"))]
|
||||
if args.is_empty() {
|
||||
#[cfg(target_os = "linux")]
|
||||
let is_server_running = crate::check_process("--server", false);
|
||||
let should_check_start_tray = crate::check_process("--server", false);
|
||||
// We can use `crate::check_process("--server", false)` on Windows.
|
||||
// Because `--server` process is the System user's process. We can't get the arguments in `check_process()`.
|
||||
// We can assume that self service running means the server is also running on Windows.
|
||||
#[cfg(target_os = "windows")]
|
||||
let is_server_running = crate::platform::is_self_service_running();
|
||||
if is_server_running && !crate::check_process("--tray", true) {
|
||||
let should_check_start_tray = crate::platform::is_self_service_running()
|
||||
&& crate::platform::is_cur_exe_the_installed();
|
||||
if should_check_start_tray && !crate::check_process("--tray", true) {
|
||||
#[cfg(target_os = "linux")]
|
||||
hbb_common::allow_err!(crate::platform::check_autostart_config());
|
||||
hbb_common::allow_err!(crate::run_me(vec!["--tray"]));
|
||||
|
||||
Reference in New Issue
Block a user