fix(Windows): hide cmd.exe window on extraction

This commit is contained in:
neoapps-dev
2026-05-21 13:49:27 +03:00
parent 8bb20a072d
commit 773da39fe1
+8 -5
View File
@@ -888,11 +888,14 @@ async fn download_and_install(app: AppHandle, state: State<'_, DownloadState>, u
#[cfg(not(target_os = "linux"))] #[cfg(not(target_os = "linux"))]
{ {
let status = Command::new("tar") let mut cmd = Command::new("tar");
.args(["-xf", zip_path.to_str().unwrap(), "-C", instance_dir.to_str().unwrap()]) cmd.args(["-xf", zip_path.to_str().unwrap(), "-C", instance_dir.to_str().unwrap()]);
.status() #[cfg(target_os = "windows")]
.map_err(|e| e.to_string())?; {
use std::os::windows::process::CommandExt;
cmd.creation_flags(0x08000000); //neo: this weird flag (named CREATE_NO_WINDOW btw) is for hiding the cmd.exe window
}
let status = cmd.status().map_err(|e| e.to_string())?;
if !status.success() { if !status.success() {
return Err("Extraction failed".into()); return Err("Extraction failed".into());
} }