Skip to content

Commit ca977f4

Browse files
authored
fix(bundler/nsis): revert shell context change before deleting appdata, closes #7588 (#7591)
* fix(bundler/nsis): delete app data of current user when uninstall, closes #7588 * fix(bundler/nsis): delete app data of current user when uninstall, closes #7588 * Update .changes/fix-nsis-uninstall-delete-app-data.md ---------
1 parent 9308dee commit ca977f4

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
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+
On Windows, Fix NSIS uninstaller deleting the wrong application data if the delete the application data checkbox is checked.

tooling/bundler/src/bundle/windows/templates/installer.nsi

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -645,12 +645,6 @@ Section Uninstall
645645
; Remove desktop shortcuts
646646
Delete "$DESKTOP\${MAINBINARYNAME}.lnk"
647647

648-
; Delete app data
649-
${If} $DeleteAppDataCheckboxState == 1
650-
RmDir /r "$APPDATA\${BUNDLEID}"
651-
RmDir /r "$LOCALAPPDATA\${BUNDLEID}"
652-
${EndIf}
653-
654648
; Remove registry information for add/remove programs
655649
!if "${INSTALLMODE}" == "both"
656650
DeleteRegKey SHCTX "${UNINSTKEY}"
@@ -662,6 +656,13 @@ Section Uninstall
662656

663657
DeleteRegValue HKCU "${MANUPRODUCTKEY}" "Installer Language"
664658

659+
; Delete app data
660+
${If} $DeleteAppDataCheckboxState == 1
661+
SetShellVarContext current
662+
RmDir /r "$APPDATA\${BUNDLEID}"
663+
RmDir /r "$LOCALAPPDATA\${BUNDLEID}"
664+
${EndIf}
665+
665666
${GetOptions} $CMDLINE "/P" $R0
666667
IfErrors +2 0
667668
SetAutoClose true

0 commit comments

Comments
 (0)