windows portable: request elevation && run as system

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2022-09-26 16:23:09 +08:00
parent 77276dd78e
commit e1c2b8de6e
5 changed files with 82 additions and 4 deletions

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 {