Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bundler/nsis): revert shell context change before deleting appdata, closes #7588 #7591

Merged
merged 3 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/fix-nsis-uninstall-delete-app-data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'tauri-bundler': 'patch:bug'
---

On Windows, Fix NSIS uninstaller deleting the wrong application data if the delete the application data checkbox is checked.
13 changes: 7 additions & 6 deletions tooling/bundler/src/bundle/windows/templates/installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -645,12 +645,6 @@ Section Uninstall
; Remove desktop shortcuts
Delete "$DESKTOP\${MAINBINARYNAME}.lnk"

; Delete app data
${If} $DeleteAppDataCheckboxState == 1
RmDir /r "$APPDATA\${BUNDLEID}"
RmDir /r "$LOCALAPPDATA\${BUNDLEID}"
${EndIf}

; Remove registry information for add/remove programs
!if "${INSTALLMODE}" == "both"
DeleteRegKey SHCTX "${UNINSTKEY}"
Expand All @@ -662,6 +656,13 @@ Section Uninstall

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

; Delete app data
${If} $DeleteAppDataCheckboxState == 1
SetShellVarContext current
RmDir /r "$APPDATA\${BUNDLEID}"
RmDir /r "$LOCALAPPDATA\${BUNDLEID}"
${EndIf}

${GetOptions} $CMDLINE "/P" $R0
IfErrors +2 0
SetAutoClose true
Expand Down
Loading