-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
63 lines (53 loc) · 1.86 KB
/
Copy pathbuild.bat
File metadata and controls
63 lines (53 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
@echo off
rem Build everything and produce the installer:
rem 1. publish the native messaging host (BrowserGuard)
rem 2. build the browser extension packages
rem 3. pack the signed crx bundled with the installer
rem 4. compile the Inno Setup installer into SetupOutput
rem
rem NOTE: keep this file ASCII-only. cmd.exe reads .bat in the OEM code page,
rem so non-ASCII comments break parsing on non-English Windows.
setlocal
set "ROOT=%~dp0"
echo.
echo === 1/4 Publishing BrowserGuard ===
dotnet publish "%ROOT%BrowserGuard\BrowserGuard.csproj" -p:PublishProfile=FolderProfile --nologo
if errorlevel 1 goto :failed
echo.
echo === 2/4 Building the browser extension ===
call "%ROOT%webextensions\build.bat" all
if errorlevel 1 goto :failed
echo.
echo === 3/4 Packing the crx ===
rem Place the designated key at webextensions\pem\edge.pem for a release build,
rem otherwise the extension ID changes on every build.
call "%ROOT%webextensions\build.bat" crx
if errorlevel 1 goto :failed
echo.
echo === 4/4 Compiling the installer ===
call :find_iscc
if not defined ISCC goto :no_iscc
"%ISCC%" "%ROOT%BrowserGuard.iss"
if errorlevel 1 goto :failed
echo.
echo Build completed. Installer is in "%ROOT%SetupOutput".
exit /b 0
rem --- helpers ---------------------------------------------------------------
:find_iscc
set "ISCC="
where iscc >nul 2>&1 && set "ISCC=iscc"
if defined ISCC exit /b 0
set "PF86=%ProgramFiles(x86)%"
if exist "%PF86%\Inno Setup 6\ISCC.exe" set "ISCC=%PF86%\Inno Setup 6\ISCC.exe"
if defined ISCC exit /b 0
if exist "%ProgramFiles%\Inno Setup 6\ISCC.exe" set "ISCC=%ProgramFiles%\Inno Setup 6\ISCC.exe"
exit /b 0
:no_iscc
echo.
echo Build failed: could not find the Inno Setup compiler (ISCC.exe).
echo Install Inno Setup 6, or add ISCC.exe to PATH.
exit /b 1
:failed
echo.
echo Build failed.
exit /b 1