mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-14 08:04:52 +01:00
re-add opening as admin
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
use crate::system_helpers::*;
|
use crate::system_helpers::*;
|
||||||
use std::path::{ Path, PathBuf };
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub async fn get_lang(window: tauri::Window, lang: String) -> String {
|
pub async fn get_lang(window: tauri::Window, lang: String) -> String {
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ fn main() {
|
|||||||
println!("You running as a non-elevated user. Some stuff will almost definitely not work.");
|
println!("You running as a non-elevated user. Some stuff will almost definitely not work.");
|
||||||
println!("===============================================================================");
|
println!("===============================================================================");
|
||||||
|
|
||||||
//reopen_as_admin();
|
reopen_as_admin();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setup datadir/cultivation just in case something went funky and it wasn't made
|
// Setup datadir/cultivation just in case something went funky and it wasn't made
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ pub fn set_proxy_addr(addr: String) {
|
|||||||
} else {
|
} else {
|
||||||
*SERVER.lock().unwrap() = addr;
|
*SERVER.lock().unwrap() = addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
|
|||||||
@@ -81,7 +81,10 @@ pub fn run_jar(path: String, execute_in: String, java_path: String) {
|
|||||||
pub fn run_un_elevated(path: String) {
|
pub fn run_un_elevated(path: String) {
|
||||||
// Open the program non-elevated.
|
// Open the program non-elevated.
|
||||||
match open::with(
|
match open::with(
|
||||||
format!("cmd /min /C \"set __COMPAT_LAYER=RUNASINVOKER && start \"\" \"{}\"\"", path),
|
format!(
|
||||||
|
"cmd /min /C \"set __COMPAT_LAYER=RUNASINVOKER && start \"\" \"{}\"\"",
|
||||||
|
path
|
||||||
|
),
|
||||||
"C:\\Windows\\System32\\cmd.exe",
|
"C:\\Windows\\System32\\cmd.exe",
|
||||||
) {
|
) {
|
||||||
Ok(_) => (),
|
Ok(_) => (),
|
||||||
@@ -165,9 +168,7 @@ pub fn set_migoto_delay(migoto_path: String) -> bool {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Set options
|
// Set options
|
||||||
conf
|
conf.with_section(Some("Loader")).set("delay", "20");
|
||||||
.with_section(Some("Loader"))
|
|
||||||
.set("delay", "20");
|
|
||||||
|
|
||||||
// Write file
|
// Write file
|
||||||
match conf.write_to_file(&migoto_pathbuf) {
|
match conf.write_to_file(&migoto_pathbuf) {
|
||||||
|
|||||||
@@ -109,7 +109,10 @@ pub fn unzip(
|
|||||||
|
|
||||||
if zipfile.contains("GIMI") {
|
if zipfile.contains("GIMI") {
|
||||||
window
|
window
|
||||||
.emit("migoto_extracted", destpath.to_string() + "3DMigoto Loader.exe")
|
.emit(
|
||||||
|
"migoto_extracted",
|
||||||
|
destpath.to_string() + "3DMigoto Loader.exe",
|
||||||
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user