portable service

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2022-11-10 10:27:13 +08:00
parent eb60ab0b79
commit 8e1545b432
46 changed files with 1217 additions and 72 deletions

View File

@@ -80,6 +80,11 @@ pub fn core_main() -> Option<Vec<String>> {
.ok();
}
}
#[cfg(windows)]
if !crate::platform::is_installed() && (_is_elevate || _is_run_as_system) {
crate::platform::elevate_or_run_as_system(click_setup, _is_elevate, _is_run_as_system);
return None;
}
if args.is_empty() {
std::thread::spawn(move || crate::start_server(false));
} else {
@@ -128,6 +133,13 @@ pub fn core_main() -> Option<Vec<String>> {
} else if args[0] == "--tray" {
crate::tray::start_tray();
return None;
} else if args[0] == "--portable-service" {
crate::platform::elevate_or_run_as_system(
click_setup,
_is_elevate,
_is_run_as_system,
);
return None;
}
}
if args[0] == "--remove" {