mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
small tweak
This commit is contained in:
@@ -145,7 +145,7 @@ pub fn is_installed_daemon(prompt: bool) -> bool {
|
||||
.args(&["load", "-w", &agent_plist_file])
|
||||
.status()
|
||||
.ok();
|
||||
std::process::exit(0);
|
||||
quit_gui();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -183,6 +183,8 @@ pub fn uninstall() -> bool {
|
||||
);
|
||||
if uninstalled {
|
||||
crate::ipc::set_option("stop-service", "Y");
|
||||
// leave ipc a little time
|
||||
std::thread::sleep(std::time::Duration::from_millis(300));
|
||||
std::process::Command::new("launchctl")
|
||||
.args(&["remove", &format!("{}_server", crate::get_full_name())])
|
||||
.status()
|
||||
@@ -202,7 +204,7 @@ pub fn uninstall() -> bool {
|
||||
))
|
||||
.spawn()
|
||||
.ok();
|
||||
std::process::exit(0);
|
||||
quit_gui();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -517,3 +519,10 @@ pub fn is_installed() -> bool {
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
fn quit_gui() {
|
||||
use cocoa::appkit::NSApp;
|
||||
unsafe {
|
||||
let () = msg_send!(NSApp(), terminate: nil);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user