diff --git a/src-tauri/src/commands/binaries.rs b/src-tauri/src/commands/binaries.rs index d3b92f8..211bea8 100644 --- a/src-tauri/src/commands/binaries.rs +++ b/src-tauri/src/commands/binaries.rs @@ -181,6 +181,10 @@ fn get_exec_location( .join(&config_info.active_version); let exec_path = exec_dir.join(bin_ext(executable_name)); if !exec_path.exists() { + log::error!( + "Could not find the required binary '{}', can't perform operation", + exec_path.to_string_lossy() + ); return Err(CommandError::BinaryExecution(format!( "Could not find the required binary '{}', can't perform operation", exec_path.to_string_lossy() @@ -270,10 +274,11 @@ pub async fn extract_and_validate_iso( let exec_info = match get_exec_location(&config_info, "extractor") { Ok(exec_info) => exec_info, Err(_) => { + log::error!("extractor executable not found"); return Ok(InstallStepOutput { success: false, msg: Some("Tooling appears to be missing critical files. This may be caused by antivirus software. You will need to redownload the version and try again.".to_string()), - }) + }); } }; @@ -305,6 +310,7 @@ pub async fn extract_and_validate_iso( match output.status.code() { Some(code) => { if code == 0 { + log::info!("extraction and validation was successful"); return Ok(InstallStepOutput { success: true, msg: None, @@ -315,15 +321,23 @@ pub async fn extract_and_validate_iso( msg: format!("Unexpected error occured with code {code}"), }; let message = error_code_map.get(&code).unwrap_or(&default_error); + log::error!("extraction and validation was not successful. Code {code}"); + log::error!("stderr: {}", String::from_utf8_lossy(&output.stderr)); + log::error!("stdout: {}", String::from_utf8_lossy(&output.stdout)); Ok(InstallStepOutput { success: false, msg: Some(message.msg.clone()), }) } - None => Ok(InstallStepOutput { - success: false, - msg: Some("Unexpected error occurred".to_owned()), - }), + None => { + log::error!("extraction and validation was not successful. No status code"); + log::error!("stderr: {}", String::from_utf8_lossy(&output.stderr)); + log::error!("stdout: {}", String::from_utf8_lossy(&output.stdout)); + Ok(InstallStepOutput { + success: false, + msg: Some("Unexpected error occurred".to_owned()), + }) + } } } @@ -339,13 +353,18 @@ pub async fn run_decompiler( let config_info = common_prelude(&config_lock)?; let data_folder = get_data_dir(&config_info, &game_name, false)?; + log::info!( + "decompiling using data folder: {}", + data_folder.to_string_lossy() + ); let exec_info = match get_exec_location(&config_info, "extractor") { Ok(exec_info) => exec_info, Err(_) => { + log::error!("extractor executable not found"); return Ok(InstallStepOutput { success: false, msg: Some("Tooling appears to be missing critical files. This may be caused by antivirus software. You will need to redownload the version and try again.".to_string()), - }) + }); } }; @@ -378,6 +397,7 @@ pub async fn run_decompiler( match output.status.code() { Some(code) => { if code == 0 { + log::info!("decompilation was successful"); return Ok(InstallStepOutput { success: true, msg: None, @@ -388,15 +408,23 @@ pub async fn run_decompiler( msg: format!("Unexpected error occured with code {code}"), }; let message = error_code_map.get(&code).unwrap_or(&default_error); + log::error!("decompilation was not successful. Code {code}"); + log::error!("stderr: {}", String::from_utf8_lossy(&output.stderr)); + log::error!("stdout: {}", String::from_utf8_lossy(&output.stdout)); Ok(InstallStepOutput { success: false, msg: Some(message.msg.clone()), }) } - None => Ok(InstallStepOutput { - success: false, - msg: Some("Unexpected error occurred".to_owned()), - }), + None => { + log::error!("decompilation was not successful. No status code"); + log::error!("stderr: {}", String::from_utf8_lossy(&output.stderr)); + log::error!("stdout: {}", String::from_utf8_lossy(&output.stdout)); + Ok(InstallStepOutput { + success: false, + msg: Some("Unexpected error occurred".to_owned()), + }) + } } } @@ -412,6 +440,10 @@ pub async fn run_compiler( let config_info = common_prelude(&config_lock)?; let data_folder = get_data_dir(&config_info, &game_name, false)?; + log::info!( + "compiling using data folder: {}", + data_folder.to_string_lossy() + ); let exec_info = match get_exec_location(&config_info, "extractor") { Ok(exec_info) => exec_info, Err(_) => { @@ -451,6 +483,7 @@ pub async fn run_compiler( match output.status.code() { Some(code) => { if code == 0 { + log::info!("compilation was successful"); return Ok(InstallStepOutput { success: true, msg: None, @@ -461,15 +494,23 @@ pub async fn run_compiler( msg: format!("Unexpected error occured with code {code}"), }; let message = error_code_map.get(&code).unwrap_or(&default_error); + log::error!("compilation was not successful. Code {code}"); + log::error!("stderr: {}", String::from_utf8_lossy(&output.stderr)); + log::error!("stdout: {}", String::from_utf8_lossy(&output.stdout)); Ok(InstallStepOutput { success: false, msg: Some(message.msg.clone()), }) } - None => Ok(InstallStepOutput { - success: false, - msg: Some("Unexpected error occurred".to_owned()), - }), + None => { + log::error!("compilation was not successful. No status code"); + log::error!("stderr: {}", String::from_utf8_lossy(&output.stderr)); + log::error!("stdout: {}", String::from_utf8_lossy(&output.stdout)); + Ok(InstallStepOutput { + success: false, + msg: Some("Unexpected error occurred".to_owned()), + }) + } } } diff --git a/src-tauri/src/commands/support.rs b/src-tauri/src/commands/support.rs index 6b01144..9ef3592 100644 --- a/src-tauri/src/commands/support.rs +++ b/src-tauri/src/commands/support.rs @@ -61,6 +61,8 @@ pub struct SupportPackage { pub gpu_info: Vec, pub game_info: PerGameInfo, pub launcher_version: String, + pub extractor_binary_exists: bool, + pub game_binary_exists: bool, } #[tauri::command] @@ -95,6 +97,35 @@ pub async fn generate_support_package( .kernel_version() .unwrap_or("unknown".to_string()); package.launcher_version = app_handle.package_info().version.to_string(); + if let Some(active_version) = &config_lock.active_version { + if cfg!(windows) { + package.extractor_binary_exists = install_path + .join("versions") + .join("official") + .join(active_version) + .join("extractor.exe") + .exists(); + package.game_binary_exists = install_path + .join("versions") + .join("official") + .join(active_version) + .join("gk.exe") + .exists(); + } else { + package.extractor_binary_exists = install_path + .join("versions") + .join("official") + .join(active_version) + .join("extractor") + .exists(); + package.game_binary_exists = install_path + .join("versions") + .join("official") + .join(active_version) + .join("gk") + .exists(); + } + } for disk in system_info.disks() { package.disk_info.push(format!( @@ -106,7 +137,6 @@ pub async fn generate_support_package( )) } - // TODO - maybe long-term this can replace glewinfo / support vulkan? let gpu_info_instance = wgpu::Instance::default(); for a in gpu_info_instance.enumerate_adapters(wgpu::Backends::all()) { let info = a.get_info(); diff --git a/src/App.svelte b/src/App.svelte index a9ad7d4..8348e44 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -103,8 +103,7 @@ {$toastStore.msg} diff --git a/src/components/games/setup/LogViewer.svelte b/src/components/games/setup/LogViewer.svelte index c694138..20bda42 100644 --- a/src/components/games/setup/LogViewer.svelte +++ b/src/components/games/setup/LogViewer.svelte @@ -11,7 +11,7 @@ } - + @@ -19,7 +19,7 @@

...{$_("setup_logs_truncation")}: diff --git a/src/lib/rpc/binaries.ts b/src/lib/rpc/binaries.ts index e7885b3..7e41aeb 100644 --- a/src/lib/rpc/binaries.ts +++ b/src/lib/rpc/binaries.ts @@ -64,7 +64,7 @@ export async function launchGame( "launch_game", { gameName, inDebug }, () => {}, - "Unable to launch game", + "_mirror_", ); } diff --git a/src/lib/rpc/rpc.ts b/src/lib/rpc/rpc.ts index 4d1613f..3c062c7 100644 --- a/src/lib/rpc/rpc.ts +++ b/src/lib/rpc/rpc.ts @@ -31,8 +31,13 @@ export async function invoke_rpc( } else { exceptionLog(`Error calling '${cmd}'`, e); } - const toastMessage = toastOnError ?? "An unexpected error occurred"; - toastStore.makeToast(toastMessage, "error"); + // TODO - this is a dumb hack but whatever for now + if (toastOnError === "_mirror_") { + toastStore.makeToast(e, "error"); + } else { + const toastMessage = toastOnError ?? "An unexpected error occurred"; + toastStore.makeToast(toastMessage, "error"); + } return handleError(e); } }