Преглед на файлове

fix(bundler/nsis): Don't use /R flag on installation dir (#9282)

Fabian-Lars преди 1 година
родител
ревизия
dbe81b8410
променени са 2 файла, в които са добавени 9 реда и са изтрити 8 реда
  1. 5 0
      .changes/bundler-r-flag.md
  2. 4 8
      tooling/bundler/src/bundle/windows/templates/installer.nsi

+ 5 - 0
.changes/bundler-r-flag.md

@@ -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.

+ 4 - 8
tooling/bundler/src/bundle/windows/templates/installer.nsi

@@ -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