From 3205c96a629e78ca04ad96dad8c7f9ee3d345c0d Mon Sep 17 00:00:00 2001 From: Thoronium <107363768+NotThorny@users.noreply.github.com> Date: Tue, 16 May 2023 13:56:40 -0600 Subject: [PATCH] Open as admin Set migoto exe when dl from menu --- src-tauri/src/main.rs | 2 +- src-tauri/src/unzip.rs | 9 +++++++++ src/ui/Main.tsx | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 8b21750..945e2bc 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -157,7 +157,7 @@ fn main() -> Result<(), ArgsError> { 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 diff --git a/src-tauri/src/unzip.rs b/src-tauri/src/unzip.rs index a2ae27f..acef719 100644 --- a/src-tauri/src/unzip.rs +++ b/src-tauri/src/unzip.rs @@ -113,6 +113,15 @@ pub fn unzip( .unwrap(); } + if zipfile.contains("GIMI") { + window + .emit( + "migoto_extracted", + destpath.to_string() + "3DMigoto Loader.exe", + ) + .unwrap(); + } + // Delete zip file match std::fs::remove_file(&zipfile) { Ok(_) => { diff --git a/src/ui/Main.tsx b/src/ui/Main.tsx index 13d1141..74e1acb 100644 --- a/src/ui/Main.tsx +++ b/src/ui/Main.tsx @@ -69,6 +69,10 @@ export class Main extends React.Component { setConfigOption('grasscutter_path', payload) }) + listen('migoto_extracted', ({ payload }: { payload: string }) => { + setConfigOption('migoto_path', payload) + }) + // Emitted for rsa replacing-purposes listen('game_closed', async () => { const wasPatched = await getConfigOption('patch_rsa')