Skip to content

Commit

Permalink
fix(bundler/nsis): Don't use /R flag on installation dir (#9282)
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianLars committed Mar 26, 2024
1 parent 017861e commit dbe81b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changes/bundler-r-flag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'tauri-bundler': 'patch:bug'
---

The NSIS uninstaller now won't mindlessly try to remove the whole installation folder when the "Remove application data" checkbox was ticked. This prevents data loss when the app was installed in a folder which contained other files.
12 changes: 4 additions & 8 deletions tooling/bundler/src/bundle/windows/templates/installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -641,14 +641,10 @@ Section Uninstall
; Delete uninstaller
Delete "$INSTDIR\uninstall.exe"

${If} $DeleteAppDataCheckboxState == 1
RMDir /R /REBOOTOK "$INSTDIR"
${Else}
{{#each resources_ancestors}}
RMDir /REBOOTOK "$INSTDIR\\{{this}}"
{{/each}}
RMDir "$INSTDIR"
${EndIf}
{{#each resources_ancestors}}
RMDir /REBOOTOK "$INSTDIR\\{{this}}"
{{/each}}
RMDir "$INSTDIR"

; Remove start menu shortcut
!insertmacro MUI_STARTMENU_GETFOLDER Application $AppStartMenuFolder
Expand Down

0 comments on commit dbe81b8

Please sign in to comment.