picoclaw/web/backend/api/exec_windows.go

25 lines
413 B
Go
Raw Normal View History

//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
}