fix: add CREATE_NO_WINDOW flag to command creation

This commit is contained in:
2025-07-31 15:35:47 +02:00
parent b6f7f84955
commit f53aba9a7b

View File

@@ -286,8 +286,18 @@ pub fn get_window_title_by_pid(pid: Pid) -> String {
} }
pub async fn is_net8_installed() -> bool { pub async fn is_net8_installed() -> bool {
use std::process::Command; use tokio::process::Command;
let output_result = Command::new("dotnet").arg("--list-runtimes").output();
let mut command = Command::new("dotnet");
command.arg("--list-runtimes");
#[cfg(windows)]
{
const CREATE_NO_WINDOW: u32 = 0x08000000;
command.creation_flags(CREATE_NO_WINDOW);
}
let output_result = command.output().await;
match output_result { match output_result {
Ok(output) => { Ok(output) => {
if !output.status.success() { if !output.status.success() {
@@ -300,9 +310,7 @@ pub async fn is_net8_installed() -> bool {
} }
let stdout_str = String::from_utf8_lossy(&output.stdout); let stdout_str = String::from_utf8_lossy(&output.stdout);
stdout_str stdout_str.lines().any(|line| line.starts_with("Microsoft.WindowsDesktop.App 8."))
.lines()
.any(|line| line.starts_with("Microsoft.WindowsDesktop.App 8."))
} }
Err(_) => false, Err(_) => false,
} }