Skip to content

Commit

Permalink
fix(bundler/nsis): don't use /R flag on installation dir
Browse files Browse the repository at this point in the history
  • Loading branch information
keiko233 committed Mar 31, 2024
1 parent c79020e commit 45e1905
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions backend/tauri/templates/installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -300,17 +300,9 @@ Function PageLeaveReinstall
reinst_done:
FunctionEnd

Function CheckInstallDir
${If} ${FileExists} "$INSTDIR\*.*"
MessageBox MB_ICONSTOP|MB_OK "The selected installation directory is not empty. Please choose an empty directory!"
Abort
${EndIf}
FunctionEnd

; 5. Choose install directoy page
!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfPassive
!insertmacro MUI_PAGE_DIRECTORY
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckInstallDir

; 6. Start menu shortcut page
!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfPassive
Expand Down Expand Up @@ -706,14 +698,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 45e1905

Please sign in to comment.