- hide windows when launching gateway process from launcher - hide windows for powershell/tasklist process inspection commands
24 lines
413 B
Go
24 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
|
|
}
|