re-add opening as admin

This commit is contained in:
SpikeHD
2023-04-21 12:47:44 -07:00
parent a6716e80f4
commit 829b9822cb
5 changed files with 12 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
use crate::system_helpers::*;
use std::path::{ Path, PathBuf };
use std::path::{Path, PathBuf};
#[tauri::command]
pub async fn get_lang(window: tauri::Window, lang: String) -> String {
@@ -55,4 +55,4 @@ pub fn emit_lang_err(window: tauri::Window, msg: String) {
res_hash.insert("error".to_string(), msg);
window.emit("lang_error", &res_hash).unwrap();
}
}

View File

@@ -58,7 +58,7 @@ fn main() {
println!("You running as a non-elevated user. Some stuff will almost definitely not work.");
println!("===============================================================================");
//reopen_as_admin();
reopen_as_admin();
}
// Setup datadir/cultivation just in case something went funky and it wasn't made

View File

@@ -47,7 +47,6 @@ pub fn set_proxy_addr(addr: String) {
} else {
*SERVER.lock().unwrap() = addr;
}
}
#[async_trait]

View File

@@ -81,7 +81,10 @@ pub fn run_jar(path: String, execute_in: String, java_path: String) {
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),
format!(
"cmd /min /C \"set __COMPAT_LAYER=RUNASINVOKER && start \"\" \"{}\"\"",
path
),
"C:\\Windows\\System32\\cmd.exe",
) {
Ok(_) => (),
@@ -165,9 +168,7 @@ pub fn set_migoto_delay(migoto_path: String) -> bool {
};
// Set options
conf
.with_section(Some("Loader"))
.set("delay", "20");
conf.with_section(Some("Loader")).set("delay", "20");
// Write file
match conf.write_to_file(&migoto_pathbuf) {

View File

@@ -109,7 +109,10 @@ pub fn unzip(
if zipfile.contains("GIMI") {
window
.emit("migoto_extracted", destpath.to_string() + "3DMigoto Loader.exe")
.emit(
"migoto_extracted",
destpath.to_string() + "3DMigoto Loader.exe",
)
.unwrap();
}