fix(windows): 内存探测 PowerShell 加 CREATE_NO_WINDOW,消除控制台弹窗

This commit is contained in:
qiqi committed 2026-11-23 00:53:43 +08:00
1 parent af3a9cdf8f
commit d9e3d84c0c
5 files changed
+11 -3

No files matched your search

+3
View File
@@ -172,8 +172,11 @@ fn app_memory_mb() -> u64 {
#[cfg(windows)]
{
let script = format!("(Get-Process -Id {}).WorkingSet64", pid);
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
let out = std::process::Command::new("powershell")
.args(["-NoProfile", "-NonInteractive", "-Command", &script])
.creation_flags(CREATE_NO_WINDOW)
.output();
if let Ok(o) = out {
if o.status.success() {