windows portable: request elevation && run as system

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages committed 2022-09-29 09:13:19 +08:00
1 parent 77276dd78e
commit e1c2b8de6e
5 files changed
+82 -4

No files matched your search

+6
View File
@@ -57,6 +57,12 @@ pub fn core_main() -> Option<Vec<String>> {
.ok();
}
}
#[cfg(windows)]
#[cfg(not(debug_assertions))]
if !crate::platform::is_installed() && args.is_empty() {
let arg = if is_setup { "--noinstall" } else { "" };
crate::platform::run_check_elevation(arg);
}
if args.is_empty() {
std::thread::spawn(move || crate::start_server(false));
} else {