diff --git a/backend/tauri/templates/installer.nsi b/backend/tauri/templates/installer.nsi index 7bee062068..1d6ce47a9f 100644 --- a/backend/tauri/templates/installer.nsi +++ b/backend/tauri/templates/installer.nsi @@ -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