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

View File

@@ -888,11 +888,14 @@ async fn download_and_install(app: AppHandle, state: State<'_, DownloadState>, u
#[cfg(not(target_os = "linux"))]
{
let status = Command::new("tar")
.args(["-xf", zip_path.to_str().unwrap(), "-C", instance_dir.to_str().unwrap()])
.status()
.map_err(|e| e.to_string())?;
let mut cmd = Command::new("tar");
cmd.args(["-xf", zip_path.to_str().unwrap(), "-C", instance_dir.to_str().unwrap()]);
#[cfg(target_os = "windows")]
{
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() {
return Err("Extraction failed".into());
}