mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2026-02-05 09:52:18 +01:00
Add non-elevated game option
This commit is contained in:
@@ -105,6 +105,7 @@ fn main() {
|
||||
system_helpers::set_migoto_delay,
|
||||
system_helpers::wipe_registry,
|
||||
system_helpers::get_platform,
|
||||
system_helpers::run_un_elevated,
|
||||
proxy::set_proxy_addr,
|
||||
proxy::generate_ca_files,
|
||||
unzip::unzip,
|
||||
|
||||
@@ -77,6 +77,18 @@ pub fn run_jar(path: String, execute_in: String, java_path: String) {
|
||||
};
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn run_un_elevated(path: String) {
|
||||
// Open the program non-elevated.
|
||||
match open::with(
|
||||
format!("cmd /min /C \"set __COMPAT_LAYER=RUNASINVOKER && start \"\" \"{}\"\"", path),
|
||||
"C:\\Windows\\System32\\cmd.exe",
|
||||
) {
|
||||
Ok(_) => (),
|
||||
Err(e) => println!("Failed to open program ({}): {}", &path, e),
|
||||
};
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn open_in_browser(url: String) {
|
||||
// Open the URL in the default browser.
|
||||
|
||||
Reference in New Issue
Block a user