error out if string is too long
This commit is contained in:
parent
b317446e7e
commit
1bedb81fca
|
@ -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…
Reference in New Issue