Skip to content

Commit 9da18e8

Browse files
committed
hopefully fix call to start
on windows 10, the title seems to be optional. But when given needs to be wrapped in quotes which seems impossible when using exec.Command. On windows 11 it seems to be required but not caring about quotes? WTF Microsoft?
1 parent 0b56dfe commit 9da18e8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/setup/windows.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,11 @@ func Uninstall() error {
7979
}
8080

8181
func Run(path string) error {
82-
// note: "golocal" is the title for the command window
83-
out, err := exec.Command("cmd", "/C", "start", "golocal", path).CombinedOutput()
82+
path = strings.Replace(path, "/", "\\", -1)
83+
84+
// note: "golocal" is the title for the command window and windows 11 seems to need it
85+
out, err := exec.Command("cmd", "/C", "start", "", "/B", path).CombinedOutput()
86+
8487
if err != nil {
8588
return fmt.Errorf("Failed to execute command.\n%s\n%s", err.Error(), out)
8689
}

0 commit comments

Comments
 (0)