@echo off setlocal EnableExtensions cd /d "%~dp0" set "APP_SPEC=Inventera_windows.spec" set "APP_EXE=dist\Inventera.Server.exe" set "INSTALLER_SCRIPT=Inventera.iss" set "POSTGRES_INSTALLER=installer\prerequisites\postgesql.exe" if not exist "%POSTGRES_INSTALLER%" ( echo. echo ERROR: PostgreSQL installer was not found. echo Download the official Windows x64 PostgreSQL installer, echo rename it to postgesql.exe and place it here: echo %~dp0%POSTGRES_INSTALLER% goto :fail ) if not exist "picture\logo\main_logo.ico" ( echo Missing installer icon: picture\logo\main_logo.ico goto :fail ) echo Installing Python build dependencies... py -m pip install --upgrade pip if errorlevel 1 goto :fail py -m pip install -r requirements.txt pyinstaller if errorlevel 1 goto :fail echo Building Inventera.Server.exe... py -m PyInstaller --clean --noconfirm "%APP_SPEC%" if errorlevel 1 ( echo Application build failed. goto :fail ) if not exist "%APP_EXE%" ( echo Application executable was not created: %APP_EXE% goto :fail ) set "ISCC_EXE=" for %%I in (ISCC.exe) do set "ISCC_EXE=%%~$PATH:I" if not defined ISCC_EXE if exist "%ProgramFiles(x86)%\Inno Setup 7\ISCC.exe" set "ISCC_EXE=%ProgramFiles(x86)%\Inno Setup 7\ISCC.exe" if not defined ISCC_EXE if exist "%ProgramFiles%\Inno Setup 7\ISCC.exe" set "ISCC_EXE=%ProgramFiles%\Inno Setup 7\ISCC.exe" if not defined ISCC_EXE if exist "%ProgramFiles(x86)%\Inno Setup 6\ISCC.exe" set "ISCC_EXE=%ProgramFiles(x86)%\Inno Setup 6\ISCC.exe" if not defined ISCC_EXE if exist "%ProgramFiles%\Inno Setup 6\ISCC.exe" set "ISCC_EXE=%ProgramFiles%\Inno Setup 6\ISCC.exe" if not defined ISCC_EXE ( echo Inno Setup was not found. Install it from https://jrsoftware.org/isdl.php goto :fail ) echo Building Inventera installer... "%ISCC_EXE%" "%INSTALLER_SCRIPT%" if errorlevel 1 ( echo Installer build failed. goto :fail ) echo. echo Build completed. echo Installer: %~dp0dist\Inventera.exe pause exit /b 0 :fail echo. echo Build stopped because of an error. pause exit /b 1