Add launch service

This commit is contained in:
chenbaiyu
2022-01-13 19:23:41 +08:00
parent f45a2c7a94
commit 9be6b17a8b
9 changed files with 204 additions and 2 deletions

View File

@@ -363,6 +363,20 @@ impl UI {
options.insert(key, value);
}
ipc::set_options(options.clone()).ok();
#[cfg(macos)]
if key == "stop-service" {
let mut service_script = "./privileges_scripts/stop_service.scpt";
if value == "Y" {
command = "./privileges_scripts/launch_service.scpt";
}
std::process::Command::new("osascript")
.arg(service_script)
.status()
.unwrap()
.success();
}
}
fn install_path(&mut self) -> String {
@@ -525,6 +539,13 @@ impl UI {
return true;
}
fn is_installed_daemon(&mut self, _prompt: bool) -> bool {
#[cfg(target_os = "macos")]
return crate::platform::macos::is_installed_daemon(_prompt);
#[cfg(not(target_os = "macos"))]
return true;
}
fn get_error(&mut self) -> String {
#[cfg(target_os = "linux")]
{
@@ -668,6 +689,7 @@ impl sciter::EventHandler for UI {
fn goto_install();
fn is_process_trusted(bool);
fn is_can_screen_recording(bool);
fn is_installed_daemon(bool);
fn get_error();
fn is_login_wayland();
fn fix_login_wayland();