Add non-elevated game option

This commit is contained in:
Thoronium
2023-04-14 23:22:34 -06:00
parent 5de80f1655
commit 7bfa5e8e11
18 changed files with 78 additions and 14 deletions

View File

@@ -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.