feat(uninstaller): remove autostart entry during uninstallation (#12643)

* feat(uninstaller): remove autostart entry during uninstallation

Signed-off-by: animeshchaudri <animeshchaudhri3@gmail.com>

* add change file

* check when not updating

* delete registry value only if install mode is "currentUser"

---------

Signed-off-by: animeshchaudri <animeshchaudhri3@gmail.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
animesh chaudhri 2025-03-17 00:58:10 +05:30 committed by GitHub
parent eec08a18b6
commit 2b960dfd9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
"tauri-bundler": patch:bug
---
Remove the autostart plugin registry entry when the app is uninstalled (NSIS only).

View File

@ -835,6 +835,16 @@ Section Uninstall
DeleteRegKey HKCU "${UNINSTKEY}"
!endif
; Removes the Autostart entry for ${PRODUCTNAME} from the HKCU Run key if it exists.
; This ensures the program does not launch automatically after uninstallation if it exists.
; If it doesn't exist, it does nothing.
; We do this when not updating (to preserve the registry value on updates)
; and when the installation is for the current user only - as it is difficult to delete registry values for other users or for the local machine
${If} $UpdateMode <> 1
${AndIf} "${INSTALLMODE}" == "currentUser"
DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "${PRODUCTNAME}"
${EndIf}
; Delete app data if the checkbox is selected
; and if not updating
${If} $DeleteAppDataCheckboxState = 1