From c218b5fc798fb38327ce78a2457a012daa965516 Mon Sep 17 00:00:00 2001 From: redstoneleo Date: Tue, 5 May 2026 10:25:08 +0800 Subject: [PATCH] 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 --- v2rayN/ServiceLib/Common/ProcUtils.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/v2rayN/ServiceLib/Common/ProcUtils.cs b/v2rayN/ServiceLib/Common/ProcUtils.cs index 3f5c31af..3c4ce2a5 100644 --- a/v2rayN/ServiceLib/Common/ProcUtils.cs +++ b/v2rayN/ServiceLib/Common/ProcUtils.cs @@ -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; }