From 34444a2b9c7a6a0680d130c1e8dfa77cf798cc5f Mon Sep 17 00:00:00 2001 From: zqm Date: Tue, 7 Apr 2026 11:04:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E6=A8=A1=E5=BC=8F=E4=B8=8B?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Windows/CS/Framework4.0/Updater/src/main.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Windows/CS/Framework4.0/Updater/src/main.rs b/Windows/CS/Framework4.0/Updater/src/main.rs index 8a6f805..3fc5d50 100644 --- a/Windows/CS/Framework4.0/Updater/src/main.rs +++ b/Windows/CS/Framework4.0/Updater/src/main.rs @@ -66,6 +66,20 @@ async fn upgrade(debug_mode: bool) { async fn main() { let config = load_config(); + if !config.debug_mode { + #[cfg(windows)] + { + use windows::Win32::System::Console; + use windows::Win32::Foundation::HWND; + unsafe { + let console = Console::GetConsoleWindow(); + if console != HWND::default() { + let _ = Console::FreeConsole(); + } + } + } + } + if config.debug_mode { let mut interval = time::interval(time::Duration::from_secs(300)); loop {