Skip to content

Commit 2b960df

Browse files
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>
1 parent eec08a1 commit 2b960df

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri-bundler": patch:bug
3+
---
4+
5+
Remove the autostart plugin registry entry when the app is uninstalled (NSIS only).

crates/tauri-bundler/src/bundle/windows/nsis/installer.nsi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,16 @@ Section Uninstall
835835
DeleteRegKey HKCU "${UNINSTKEY}"
836836
!endif
837837

838+
; Removes the Autostart entry for ${PRODUCTNAME} from the HKCU Run key if it exists.
839+
; This ensures the program does not launch automatically after uninstallation if it exists.
840+
; If it doesn't exist, it does nothing.
841+
; We do this when not updating (to preserve the registry value on updates)
842+
; 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
843+
${If} $UpdateMode <> 1
844+
${AndIf} "${INSTALLMODE}" == "currentUser"
845+
DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "${PRODUCTNAME}"
846+
${EndIf}
847+
838848
; Delete app data if the checkbox is selected
839849
; and if not updating
840850
${If} $DeleteAppDataCheckboxState = 1

0 commit comments

Comments
 (0)