From 693e61d7d4e57be0b156fae980f3774a3fadaf6d Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sat, 10 Aug 2019 15:54:51 -0600 Subject: [PATCH] address windows bug with incomplete args[0] paths --- manager/install_windows.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/manager/install_windows.go b/manager/install_windows.go index 5349fd5..9897c20 100644 --- a/manager/install_windows.go +++ b/manager/install_windows.go @@ -6,6 +6,7 @@ import ( "io/ioutil" "log" "os" + "os/exec" "path/filepath" "strings" @@ -288,6 +289,13 @@ func installServiceman(c *service.Service) ([]string, error) { if nil != err { return nil, err } + // Note: self may be the short name, in which case + // we should just use whatever is closest in the path + // exec.LookPath will handle this correctly + self, err = exec.LookPath(self) + if nil != err { + return nil, err + } bin, err := ioutil.ReadFile(self) if nil != err { return nil, err