From 00749b34658b82d51e25fd6489ed6b568394c53f Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 4 Jul 2019 03:36:58 -0600 Subject: [PATCH] win: copy debug self to debug location --- manager/install_windows.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/manager/install_windows.go b/manager/install_windows.go index e466644..01c2578 100644 --- a/manager/install_windows.go +++ b/manager/install_windows.go @@ -100,11 +100,15 @@ func install(c *service.Service) error { func installServiceman(c *service.Service) ([]string, error) { // TODO check version and upgrade or dismiss self := os.Args[0] + debug := "" + if strings.Contains(self, "debug.exe") { + debug = "debug." + } smdir := `\opt\serviceman` // TODO support service level services (which probably wouldn't need serviceman) smdir = filepath.Join(c.Home, ".local", smdir) // for now we'll scope the runner to the name of the application - smbin := filepath.Join(smdir, `bin\serviceman.`+c.Name+`.exe`) + smbin := filepath.Join(smdir, `bin\serviceman.`+debug+c.Name+`.exe`) if smbin != self { err := os.MkdirAll(filepath.Dir(smbin), 0755)