Cross-platform desktop daemon for WellSpr.ing / NNN.today merchants. Runs silently at login on Windows (Task Scheduler), macOS (LaunchAgent), and Linux (systemd user service). Build commands: Windows: GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-s -w -H=windowsgui" -o ody-agent-win.exe . macOS: GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -ldflags "-s -w" -o ody-agent-mac . Linux: GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-s -w" -o ody-agent-linux .
17 lines
405 B
Go
17 lines
405 B
Go
//go:build windows
|
|
|
|
package main
|
|
|
|
import (
|
|
"os/exec"
|
|
"syscall"
|
|
)
|
|
|
|
// noWindow sets CREATE_NO_WINDOW on the command so that spawning powershell,
|
|
// rundll32, or any other subprocess never flashes a console/DOS window on
|
|
// the user's desktop. Must be called before cmd.Start().
|
|
func noWindow(cmd *exec.Cmd) {
|
|
cmd.SysProcAttr = &syscall.SysProcAttr{
|
|
CreationFlags: 0x08000000, // CREATE_NO_WINDOW
|
|
}
|
|
}
|