- Use Task Scheduler XML instead of /TR - Run -ensure agent in-process, not child - Add console close and panic protection - Guard nil event channels after stop - Add non-Windows stubs for startup/mutex
19 lines
258 B
Go
19 lines
258 B
Go
package instance
|
|
|
|
import (
|
|
"os"
|
|
|
|
"tea.chunkbyte.com/kato/go-worm/lib/config"
|
|
)
|
|
|
|
func Detach() error {
|
|
if AlreadyRunning() {
|
|
return nil
|
|
}
|
|
exe, err := config.InstalledExe()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return Launch(exe, filterArgs(os.Args[1:]))
|
|
}
|