Browse Source

error out if string is too long

installer
AJ ONeal 5 years ago
parent
commit
1bedb81fca
  1. 3
      cmd/watchdog/installer/install_windows.go

3
cmd/watchdog/installer/install_windows.go

@ -74,6 +74,9 @@ func install(c *Config) error {
// "C:\Users\aj\.local\opt\appname\appname.js /c -p 8080"
// "C:\Program Files (x64)\nodejs\node.exe /c C:\Users\aj\.local\opt\appname\appname.js -p 8080"
regSZ := bin + setArgs + strings.Join(c.Argv, " ")
if len(regSZ) > 260 {
return fmt.Errorf("data value is too long for registry entry")
}
fmt.Println("Set Registry Key:")
fmt.Println(autorunKey, c.Title, regSZ)
k.SetStringValue(c.Title, regSZ)

Loading…
Cancel
Save