mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-20 13:49:07 +02:00
[client] Preserve user autostart setting across Windows NSIS upgrades
The NSIS upgrade path runs the previous version's uninstaller before reinstalling, and that uninstaller deleted the per-user HKCU Run value that the UI's Wails autostart toggle owns. As a result every EXE-based auto-update silently wiped the user's launch-on-login choice. Stop deleting the HKCU value on uninstall; a leftover entry after a genuine uninstall is harmless since Windows ignores Run values whose target no longer exists. The legacy machine-wide HKLM entry is still cleaned up.
This commit is contained in:
@@ -299,14 +299,14 @@ ExecWait '"$INSTDIR\${MAIN_APP_EXE}" service uninstall'
|
|||||||
DetailPrint "Terminating Netbird UI process..."
|
DetailPrint "Terminating Netbird UI process..."
|
||||||
ExecWait `taskkill /im ${UI_APP_EXE}.exe /f`
|
ExecWait `taskkill /im ${UI_APP_EXE}.exe /f`
|
||||||
|
|
||||||
; Remove autostart registry entries
|
; Remove the legacy machine-wide autostart entry older installers wrote.
|
||||||
DetailPrint "Removing autostart registry entries if they exist..."
|
; The per-user HKCU\...\Run value is owned by the UI's Wails toggle and is
|
||||||
; Legacy machine-wide entry written by older installers.
|
; left untouched here: the NSIS upgrade path runs this uninstaller before
|
||||||
|
; reinstalling, so deleting it would wipe the user's launch-on-login choice
|
||||||
|
; on every update. A leftover entry after a genuine uninstall is harmless --
|
||||||
|
; Windows ignores Run values whose target executable no longer exists.
|
||||||
|
DetailPrint "Removing legacy machine-wide autostart entry if present..."
|
||||||
DeleteRegValue HKLM "${AUTOSTART_REG_KEY}" "${APP_NAME}"
|
DeleteRegValue HKLM "${AUTOSTART_REG_KEY}" "${APP_NAME}"
|
||||||
; Per-user entry the UI toggle writes via Wails (value name is the lowercase
|
|
||||||
; app-name slug). Uninstall removes the app, so drop it too.
|
|
||||||
DeleteRegValue HKCU "${AUTOSTART_REG_KEY}" "${APP_NAME}"
|
|
||||||
DeleteRegValue HKCU "${AUTOSTART_REG_KEY}" "netbird"
|
|
||||||
|
|
||||||
; Handle data deletion based on checkbox
|
; Handle data deletion based on checkbox
|
||||||
DetailPrint "Checking if user requested data deletion..."
|
DetailPrint "Checking if user requested data deletion..."
|
||||||
|
|||||||
Reference in New Issue
Block a user