-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
67 lines (58 loc) · 2.09 KB
/
Copy pathbuild.bat
File metadata and controls
67 lines (58 loc) · 2.09 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
@echo off
for /f "usebackq delims=" %%V in (`powershell -NoProfile -Command "[xml]$proj = Get-Content 'src\WinNotch\WinNotch.csproj'; $proj.Project.PropertyGroup.Version"`) do set "APP_VERSION=%%V"
if not defined APP_VERSION set "APP_VERSION=unknown"
echo ========================================
echo WinNotch v%APP_VERSION% - Build Release
echo ========================================
echo.
cd /d "%~dp0"
echo Cleaning previous builds...
if exist "publish" rmdir /s /q "publish"
echo.
echo [1/2] Building self-contained single-file executable...
dotnet publish src\WinNotch\WinNotch.csproj ^
-c Release ^
-o publish
if %ERRORLEVEL% NEQ 0 (
echo.
echo BUILD FAILED!
pause
exit /b 1
)
echo.
echo ========================================
echo Build complete!
echo Output: publish\WinNotch.exe
echo ========================================
for %%A in ("publish\WinNotch.exe") do echo Size: %%~zA bytes
echo.
:: Build installer if Inno Setup is available
set "ISCC="
if exist "%ProgramFiles(x86)%\Inno Setup 6\ISCC.exe" set "ISCC=%ProgramFiles(x86)%\Inno Setup 6\ISCC.exe"
if exist "%ProgramFiles%\Inno Setup 6\ISCC.exe" set "ISCC=%ProgramFiles%\Inno Setup 6\ISCC.exe"
if defined ISCC (
echo [2/2] Building installer with Inno Setup...
"%ISCC%" "/DMyAppVersion=%APP_VERSION%" installer\WinNotch.iss
if %ERRORLEVEL% NEQ 0 (
echo.
echo INSTALLER BUILD FAILED!
pause
exit /b 1
)
echo.
echo ========================================
echo Installer created!
echo Output: publish\installer\WinNotch-%APP_VERSION%-Setup.exe
echo ========================================
for %%A in ("publish\installer\WinNotch-%APP_VERSION%-Setup.exe") do echo Size: %%~zA bytes
) else (
echo [2/2] Inno Setup not found - skipping installer.
echo Install from: https://jrsoftware.org/isinfo.php
echo Then re-run this script to build the installer.
)
echo.
echo Done! Release artifacts:
echo - publish\WinNotch.exe (standalone)
if defined ISCC echo - publish\installer\WinNotch-%APP_VERSION%-Setup.exe (installer)
echo.
pause