mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
e1863234f0
- hide windows when launching gateway process from launcher - hide windows for powershell/tasklist process inspection commands
25 lines
413 B
Go
25 lines
413 B
Go
//go:build windows
|
|
|
|
package api
|
|
|
|
import (
|
|
"os/exec"
|
|
"syscall"
|
|
)
|
|
|
|
func launcherExecCommand(name string, args ...string) *exec.Cmd {
|
|
cmd := exec.Command(name, args...)
|
|
applyLauncherWindowsProcAttrs(cmd)
|
|
return cmd
|
|
}
|
|
|
|
func applyLauncherWindowsProcAttrs(cmd *exec.Cmd) {
|
|
if cmd == nil {
|
|
return
|
|
}
|
|
if cmd.SysProcAttr == nil {
|
|
cmd.SysProcAttr = &syscall.SysProcAttr{}
|
|
}
|
|
cmd.SysProcAttr.HideWindow = true
|
|
}
|