[fix] powershell black screens and try to solve update re-start not working
This commit is contained in:
@@ -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()?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user