mirror of
https://github.com/LCE-Hub/LCE-Emerald-Launcher.git
synced 2026-05-21 17:54:30 +00:00
fix(Windows): hide cmd.exe window on extraction
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user