diff --git a/hostinfo/hostinfo_windows.go b/hostinfo/hostinfo_windows.go index b789efb28..f0422f5a0 100644 --- a/hostinfo/hostinfo_windows.go +++ b/hostinfo/hostinfo_windows.go @@ -72,10 +72,6 @@ func packageTypeWindows() string { if _, err := os.Stat(`C:\ProgramData\chocolatey\lib\tailscale`); err == nil { return "choco" } - msiSentinel, _ := winutil.GetRegInteger("MSI") - if msiSentinel == 1 { - return "msi" - } exe, err := os.Executable() if err != nil { return "" @@ -84,13 +80,15 @@ func packageTypeWindows() string { if strings.HasPrefix(exe, filepath.Join(home, "scoop", "apps", "tailscale")) { return "scoop" } - dir := filepath.Dir(exe) - nsisUninstaller := filepath.Join(dir, "Uninstall-Tailscale.exe") - _, err = os.Stat(nsisUninstaller) - if err == nil { - return "nsis" + msiSentinel, _ := winutil.GetRegInteger("MSI") + if msiSentinel != 1 { + // Atypical. Not worth trying to detect. Likely open + // source tailscaled or a developer running by hand. + return "" } - // Atypical. Not worth trying to detect. Likely open - // source tailscaled or a developer running by hand. - return "" + result := "msi" + if env, _ := winutil.GetRegString("MSIDist"); env != "" { + result += "/" + env + } + return result }