소스 검색

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