-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.bat
More file actions
59 lines (49 loc) · 1.56 KB
/
Copy pathpackage.bat
File metadata and controls
59 lines (49 loc) · 1.56 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
@echo off
setlocal
REM Build publish output and compile the Inno Setup installer.
set "ROOT=%~dp0"
cd /d "%ROOT%"
echo ===== MonsterDeck: Package (build + installer) =====
echo.
echo [1/3] Building published EXE...
call apps\MonsterDeck\build.bat || (
echo Build failed.
exit /b 1
)
set "PUBLISH_EXE=%CD%\apps\MonsterDeck\bin\x64\Release\net8.0-windows\win-x64\publish\MonsterDeck.exe"
if not exist "%PUBLISH_EXE%" set "PUBLISH_EXE=%CD%\apps\MonsterDeck\bin\Release\net8.0-windows\win-x64\publish\MonsterDeck.exe"
if not exist "%PUBLISH_EXE%" (
echo ERROR: Published EXE not found.
goto :err
)
echo [2/3] Locating Inno Setup Compiler (ISCC.exe)...
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 not found. Please install it from https://jrsoftware.org/isinfo.php
exit /b 1
)
echo [3/3] Compiling installer...
pushd installer
"%ISCC%" monsterdeck.iss || (
popd
echo Inno Setup compilation failed.
exit /b 1
)
REM Find newest installer file (Inno places it under Output by default)
set "OUTFILE="
for /f "delims=" %%A in ('dir /b /od Output\MonsterDeck-*-Setup.exe 2^>nul') do set "OUTFILE=Output\%%A"
if not defined OUTFILE (
for /f "delims=" %%A in ('dir /b /od MonsterDeck-*-Setup.exe 2^>nul') do set "OUTFILE=%%A"
)
if not defined OUTFILE (
popd
echo ERROR: Installer EXE not found in installer\ (nor in installer\Output\)
exit /b 1
)
set "OUTFULL=%CD%\%OUTFILE%"
popd
echo.
echo Success. Installer built:
echo %OUTFULL%
exit /b 0