Skip to content

Commit

Permalink
chore: fix nsis installer empty dir check
Browse files Browse the repository at this point in the history
  • Loading branch information
keiko233 committed Mar 22, 2024
1 parent 7772167 commit 78b18de
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions backend/tauri/templates/installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,17 @@ 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

0 comments on commit 78b18de

Please sign in to comment.