mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-14 08:04:52 +01:00
Add non-elevated game option
This commit is contained in:
@@ -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