From 1b4d6f590b7ef4c30fc9e6a1c579742c591e7258 Mon Sep 17 00:00:00 2001 From: neoapps-dev Date: Thu, 18 Jun 2026 23:55:44 +0300 Subject: [PATCH] feat: unzip fallback --- src-tauri/src/commands/download.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src-tauri/src/commands/download.rs b/src-tauri/src/commands/download.rs index 6942c29..a2be611 100644 --- a/src-tauri/src/commands/download.rs +++ b/src-tauri/src/commands/download.rs @@ -61,13 +61,22 @@ pub async fn download_and_install( { *state.token.lock().await = None; } #[cfg(target_os = "linux")] { - let status = std::process::Command::new("bsdtar") + let bsdtar_ok = std::process::Command::new("bsdtar") .args(["-xf", zip_path.to_str().unwrap(), "-C", instance_dir.to_str().unwrap()]) .status() - .map_err(|e| e.to_string())?; + .map(|s| s.success()) + .unwrap_or(false); - if !status.success() { - return Err("Extraction failed".into()); + if !bsdtar_ok { + let unzip_ok = std::process::Command::new("unzip") + .args(["-o", zip_path.to_str().unwrap(), "-d", instance_dir.to_str().unwrap()]) + .status() + .map(|s| s.success()) + .unwrap_or(false); + + if !unzip_ok { + return Err("Extraction failed".into()); + } } }