|
| 1 | +@echo off |
| 2 | +rem Build everything and produce the installer: |
| 3 | +rem 1. publish the native messaging host (BrowserGuard) |
| 4 | +rem 2. build the browser extension packages |
| 5 | +rem 3. compile the Inno Setup installer into SetupOutput |
| 6 | +rem |
| 7 | +rem NOTE: keep this file ASCII-only. cmd.exe reads .bat in the OEM code page, |
| 8 | +rem so non-ASCII comments break parsing on non-English Windows. |
| 9 | + |
| 10 | +setlocal |
| 11 | +set "ROOT=%~dp0" |
| 12 | + |
| 13 | +echo. |
| 14 | +echo === 1/3 Publishing BrowserGuard === |
| 15 | +dotnet publish "%ROOT%BrowserGuard\BrowserGuard.csproj" -p:PublishProfile=FolderProfile --nologo |
| 16 | +if errorlevel 1 goto :failed |
| 17 | + |
| 18 | +echo. |
| 19 | +echo === 2/3 Building the browser extension === |
| 20 | +call "%ROOT%webextensions\build.bat" all |
| 21 | +if errorlevel 1 goto :failed |
| 22 | + |
| 23 | +echo. |
| 24 | +echo === 3/3 Compiling the installer === |
| 25 | +call :find_iscc |
| 26 | +if not defined ISCC goto :no_iscc |
| 27 | +"%ISCC%" "%ROOT%BrowserGuard.iss" |
| 28 | +if errorlevel 1 goto :failed |
| 29 | + |
| 30 | +echo. |
| 31 | +echo Build completed. Installer is in "%ROOT%SetupOutput". |
| 32 | +exit /b 0 |
| 33 | + |
| 34 | +rem --- helpers --------------------------------------------------------------- |
| 35 | + |
| 36 | +:find_iscc |
| 37 | +set "ISCC=" |
| 38 | +where iscc >nul 2>&1 && set "ISCC=iscc" |
| 39 | +if defined ISCC exit /b 0 |
| 40 | +set "PF86=%ProgramFiles(x86)%" |
| 41 | +if exist "%PF86%\Inno Setup 6\ISCC.exe" set "ISCC=%PF86%\Inno Setup 6\ISCC.exe" |
| 42 | +if defined ISCC exit /b 0 |
| 43 | +if exist "%ProgramFiles%\Inno Setup 6\ISCC.exe" set "ISCC=%ProgramFiles%\Inno Setup 6\ISCC.exe" |
| 44 | +exit /b 0 |
| 45 | + |
| 46 | +:no_iscc |
| 47 | +echo. |
| 48 | +echo Build failed: could not find the Inno Setup compiler (ISCC.exe). |
| 49 | +echo Install Inno Setup 6, or add ISCC.exe to PATH. |
| 50 | +exit /b 1 |
| 51 | + |
| 52 | +:failed |
| 53 | +echo. |
| 54 | +echo Build failed. |
| 55 | +exit /b 1 |
0 commit comments