[fix] powershell black screens and try to solve update re-start not working

This commit is contained in:
2025-11-08 19:14:18 +08:00
parent c50fedd305
commit 11afc6dc9e
12 changed files with 357 additions and 281 deletions

View File

@@ -36,10 +36,15 @@ pub fn get_exe_path(name: &str) -> Result<String, std::io::Error> {
// ----
// 进程路径
let command = format!("Get-Process {} | Select-Object path", name);
let args = command.split_whitespace().collect::<Vec<&str>>();
#[cfg(windows)]
let output = Command::new("powershell.exe")
.args(&args)
.args(&[
"-NoProfile",
"-WindowStyle",
"Hidden",
"-Command",
&command,
])
.creation_flags(CREATE_NO_WINDOW)
.output()?;