summaryrefslogtreecommitdiffstatshomepage
path: root/src-tauri/src/core/forge.rs
diff options
context:
space:
mode:
authorHsiangNianian <i@jyunko.cn>2026-01-16 14:40:02 +0800
committerHsiangNianian <i@jyunko.cn>2026-01-16 14:40:02 +0800
commit9c366b8d5c3f68d19bb87ed354b42b48c99b66c5 (patch)
tree24f419993f1504ebbbb712be9a3a0ba34906ef82 /src-tauri/src/core/forge.rs
parent3c92f8555913fbcd9b13a06ef1bbb3d326679a48 (diff)
downloadDropOut-9c366b8d5c3f68d19bb87ed354b42b48c99b66c5.tar.gz
DropOut-9c366b8d5c3f68d19bb87ed354b42b48c99b66c5.zip
feat: improve Java command execution on Windows
Enhanced the Java command execution by adding support for Windows-specific creation flags in both the installer and candidate checking functions. This change ensures better compatibility and performance when running Java commands on Windows systems.
Diffstat (limited to 'src-tauri/src/core/forge.rs')
-rw-r--r--src-tauri/src/core/forge.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/src-tauri/src/core/forge.rs b/src-tauri/src/core/forge.rs
index c8bd6e4..0528b76 100644
--- a/src-tauri/src/core/forge.rs
+++ b/src-tauri/src/core/forge.rs
@@ -9,6 +9,8 @@
use serde::{Deserialize, Serialize};
use std::error::Error;
+#[cfg(target_os = "windows")]
+use std::os::windows::process::CommandExt;
use std::path::PathBuf;
const FORGE_PROMOTIONS_URL: &str =
@@ -293,13 +295,16 @@ pub async fn run_forge_installer(
// Run the installer in headless mode
// The installer accepts --installClient <path> to install to a specific directory
- let output = tokio::process::Command::new(java_path)
- .arg("-jar")
+ let mut cmd = tokio::process::Command::new(java_path);
+ cmd.arg("-jar")
.arg(&installer_path)
.arg("--installClient")
- .arg(game_dir)
- .output()
- .await?;
+ .arg(game_dir);
+
+ #[cfg(target_os = "windows")]
+ cmd.creation_flags(0x08000000);
+
+ let output = cmd.output().await?;
// Clean up installer
let _ = tokio::fs::remove_file(&installer_path).await;