winutil: refactor methods to get values from registry to also return (#9536)

errors
Updates tailscale/corp#14879

Signed-off-by: Claire Wang <claire@tailscale.com>
This commit is contained in:
Claire Wang
2023-09-26 13:15:11 -04:00
committed by GitHub
parent c608660d12
commit e3d6236606
9 changed files with 80 additions and 58 deletions

View File

@@ -62,7 +62,8 @@ func packageTypeWindows() string {
if _, err := os.Stat(`C:\ProgramData\chocolatey\lib\tailscale`); err == nil {
return "choco"
}
if msiSentinel := winutil.GetRegInteger("MSI", 0); msiSentinel == 1 {
msiSentinel, _ := winutil.GetRegInteger("MSI")
if msiSentinel == 1 {
return "msi"
}
exe, err := os.Executable()