This small application allows to start multiple programs at once and if one of them is closed, the others are killed. Tested on Windows 11 and MacOS 14.5
go build -o="runsyncapps.exe" ./cmd/
On Windows, You can add the build flag -ldflags="-H windowsgui"
to avoid the console to open when starting the app.
runsyncapps.exe --config=myconfig.json --log
config
: path of the config file (config.json
by default)log
: log events in atrace_<timestamp>.log
file (disabled by default)
The configuration file looks like this:
{
"waitCheck": 10,
"waitExit": 10,
"applications": [
{
"path": "C:\\Windows\\System32\\dxdiag.exe",
"useExistingInstance": false,
"killOnExit": true
},
{
"path": "C:\\Windows\\System32\\charmap.exe",
"useExistingInstance": false,
"killOnExit": true
},
{
"path": "C:\\Windows\\System32\\msinfo32.exe",
"useExistingInstance": false,
"killOnExit": false
}
]
}
The parameters are the following:
waitCheck
: timer (in seconds) after the processes are being monitoredwaitExit
: timer (in seconds) before the processes are being killedapplications
: array of application to start:path
: full path of the applicationuseExistingInstance
: don't start a new instance if there is one already runningkillOnExit
: kill the application if it's running after another app has been killed
A system tray icon allows the using to exit the application without killing the child processes.
This works by default on Windows.
On MacOS you will need to bundle the application (see getlantern/systray lib info and official Apple documentation).