fix: hide CMD window when launching upgrade process (AmazTool)

Add WindowStyle = ProcessWindowStyle.Hidden to ProcUtils.ProcessStart
and ProcUtils.RebootAsAdmin to prevent the black console window
from popping up during automatic updates and restarts.

Fixes #8240
This commit is contained in:
redstoneleo 2026-05-05 10:25:08 +08:00
parent 8450f2e420
commit c218b5fc79

View file

@ -33,7 +33,8 @@ public static class ProcUtils
UseShellExecute = true,
FileName = fileName,
Arguments = arguments,
WorkingDirectory = dir ?? string.Empty
WorkingDirectory = dir ?? string.Empty,
WindowStyle = ProcessWindowStyle.Hidden
}
};
_ = proc.Start();
@ -57,6 +58,7 @@ public static class ProcUtils
WorkingDirectory = Utils.StartupPath(),
FileName = Utils.GetExePath().AppendQuotes(),
Verb = blAdmin ? "runas" : null,
WindowStyle = ProcessWindowStyle.Hidden
};
return Process.Start(startInfo) != null;
}