diff --git a/src-tauri/src/commands/binaries.rs b/src-tauri/src/commands/binaries.rs index 781ef743..e5ad1951 100644 --- a/src-tauri/src/commands/binaries.rs +++ b/src-tauri/src/commands/binaries.rs @@ -234,6 +234,7 @@ pub async fn extract_and_validate_iso( app_handle: tauri::AppHandle, path_to_iso: String, game_name: String, + via_folder: bool, ) -> Result { let config_lock = config.lock().await; let config_info = common_prelude(&config_lock)?; @@ -261,7 +262,7 @@ pub async fn extract_and_validate_iso( "--proj-path".to_string(), data_folder.to_string_lossy().into_owned(), ]; - if Path::new(&path_to_iso.clone()).is_dir() { + if via_folder { args.push("--folder".to_string()); } // Add new --game argument @@ -335,6 +336,7 @@ pub async fn run_decompiler( game_name: String, truncate_logs: bool, use_decomp_settings: bool, + via_folder: bool, ) -> Result { let config_lock = config.lock().await; let config_info = common_prelude(&config_lock)?; @@ -408,6 +410,10 @@ pub async fn run_decompiler( args.push(game_name.clone()); } + if via_folder { + args.push("--folder".to_string()); + } + // TODO NOW - minimum if !decomp_config_overrides.is_empty() { args.push("--decomp-config-override".to_string()); @@ -483,6 +489,7 @@ pub async fn run_compiler( path_to_iso: String, game_name: String, truncate_logs: bool, + via_folder: bool, ) -> Result { let config_lock = config.lock().await; let config_info = common_prelude(&config_lock)?; @@ -523,6 +530,10 @@ pub async fn run_compiler( args.push(game_name.clone()); } + if via_folder { + args.push("--folder".to_string()); + } + log::info!("Running compiler with args: {:?}", args); let mut command = Command::new(exec_info.executable_path); diff --git a/src/components/games/setup/GameSetup.svelte b/src/components/games/setup/GameSetup.svelte index 56ed3e55..ed02121a 100644 --- a/src/components/games/setup/GameSetup.svelte +++ b/src/components/games/setup/GameSetup.svelte @@ -108,6 +108,7 @@ let resp = await extractAndValidateISO( sourcePath, getInternalName(activeGame), + viaFolder, ); if (!resp.success) { progressTracker.halt(); @@ -120,6 +121,7 @@ getInternalName(activeGame), false, false, + viaFolder, ); if (!resp.success) { progressTracker.halt(); @@ -127,7 +129,12 @@ return; } progressTracker.proceed(); - resp = await runCompiler(sourcePath, getInternalName(activeGame)); + resp = await runCompiler( + sourcePath, + getInternalName(activeGame), + false, + viaFolder, + ); if (!resp.success) { progressTracker.halt(); installationError = resp.msg; @@ -201,11 +208,10 @@ >{$_("setup_button_installViaISO")} - + on:click={async () => await install(true)}>Install via Folder {/if} diff --git a/src/lib/rpc/binaries.ts b/src/lib/rpc/binaries.ts index 0f2f90a8..20987718 100644 --- a/src/lib/rpc/binaries.ts +++ b/src/lib/rpc/binaries.ts @@ -21,10 +21,11 @@ export async function updateDataDirectory( export async function extractAndValidateISO( pathToIso: string, gameName: string, + viaFolder: boolean = false, ): Promise { return await invoke_rpc( "extract_and_validate_iso", - { pathToIso, gameName }, + { pathToIso, gameName, viaFolder }, () => failed("Failed to extract and validate ISO"), ); } @@ -34,10 +35,11 @@ export async function runDecompiler( gameName: string, truncateLogs: boolean = false, useDecompSettings: boolean = false, + viaFolder: boolean = false, ): Promise { return await invoke_rpc( "run_decompiler", - { pathToIso, gameName, truncateLogs, useDecompSettings }, + { pathToIso, gameName, truncateLogs, useDecompSettings, viaFolder }, () => failed("Failed to run decompiler"), ); } @@ -46,10 +48,11 @@ export async function runCompiler( pathToIso: string, gameName: string, truncateLogs: boolean = false, + viaFolder: boolean = false, ): Promise { return await invoke_rpc( "run_compiler", - { pathToIso, gameName, truncateLogs }, + { pathToIso, gameName, truncateLogs, viaFolder }, () => failed("Failed to run compiler"), ); }