-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildInstaller.bat
More file actions
87 lines (73 loc) · 2.5 KB
/
Copy pathBuildInstaller.bat
File metadata and controls
87 lines (73 loc) · 2.5 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@echo off
setlocal EnableExtensions
cd /d "%~dp0"
title TrueAuto HDR 1.5.0 - Installer Builder
where dotnet >nul 2>nul
if errorlevel 1 (
echo [ERROR] .NET 8 SDK not found in PATH.
if not defined TRUEAUTOHDR_NO_PAUSE pause
exit /b 1
)
set "ISCC=%ProgramFiles(x86)%\Inno Setup 6\ISCC.exe"
if not exist "%ISCC%" set "ISCC=%ProgramFiles%\Inno Setup 6\ISCC.exe"
if not exist "%ISCC%" (
echo [ERROR] Inno Setup 6 was not found.
if not defined TRUEAUTOHDR_NO_PAUSE pause
exit /b 1
)
set "OUT=%~dp0release\InstallerInput"
if exist "%OUT%" rmdir /s /q "%OUT%"
mkdir "%OUT%" >nul 2>nul
if not exist "%~dp0release\Installer" mkdir "%~dp0release\Installer" >nul 2>nul
echo [1/8] Building updater...
call "%~dp0BuildUpdater.bat"
if errorlevel 1 goto :failed
echo [2/8] Publishing installer payload...
dotnet publish "%~dp0AutoHDR.csproj" ^
-c Release ^
-r win-x64 ^
--self-contained true ^
-p:PublishSingleFile=true ^
-p:PublishReadyToRun=true ^
-p:DebugType=None ^
-p:DebugSymbols=false ^
-o "%OUT%"
if errorlevel 1 goto :failed
echo [3/8] Adding updater...
copy /y "%~dp0publish-updater\TrueAutoHDR.Updater.exe" "%OUT%\TrueAutoHDR.Updater.exe" >nul
if errorlevel 1 goto :failed
echo [4/8] Verifying payload...
if not exist "%OUT%\TrueAutoHDR.exe" goto :missing
if not exist "%OUT%\TrueAutoHDR.Updater.exe" goto :missing
if not exist "%OUT%\Database\native_hdr_database.json" goto :missing
if not exist "%OUT%\Database\community_hdr_names.json" goto :missing
echo [5/8] Optional code signing of application payload...
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0SignRelease.ps1" -Path "%OUT%"
if errorlevel 1 goto :failed
echo [6/8] Running installer-payload self-test...
"%OUT%\TrueAutoHDR.exe" --self-test
if errorlevel 1 (
echo [ERROR] Installer payload failed self-test.
goto :failed
)
echo [7/8] Compiling installer...
"%ISCC%" "%~dp0Installer\TrueAutoHDR.iss"
if errorlevel 1 goto :failed
echo [8/8] Optional code signing of installer...
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0SignRelease.ps1" -Path "%~dp0release\Installer\TrueAutoHDR-1.5.0-Setup.exe"
if errorlevel 1 goto :failed
echo.
echo Installer complete:
echo %~dp0release\Installer\TrueAutoHDR-1.5.0-Setup.exe
if not defined TRUEAUTOHDR_NO_PAUSE pause
exit /b 0
:missing
echo [ERROR] Required release file is missing.
goto :failed
:failed
echo.
echo ========================================
echo INSTALLER BUILD FAILED
echo ========================================
if not defined TRUEAUTOHDR_NO_PAUSE pause
exit /b 1