-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-release.bat
More file actions
86 lines (75 loc) · 2.33 KB
/
build-release.bat
File metadata and controls
86 lines (75 loc) · 2.33 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
@echo off
REM ============================================================
REM Crypto Miner Optimizer - Release Build & Package Script
REM Run this from "x64 Native Tools Command Prompt for VS 2022"
REM ============================================================
setlocal
set QT_DIR=C:\Qt\6.10.1\msvc2022_64
set INNO_SETUP="C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
echo.
echo ========================================
echo Step 1: Building Web UI
echo ========================================
call npm install
call npm run build
if errorlevel 1 (
echo ERROR: Web build failed!
exit /b 1
)
echo.
echo ========================================
echo Step 2: Building Qt Application
echo ========================================
if exist qt\build rmdir /s /q qt\build
cmake -S qt -B qt\build -G Ninja -DCMAKE_BUILD_TYPE=Release -DQt6_DIR="%QT_DIR%\lib\cmake\Qt6"
if errorlevel 1 (
echo ERROR: CMake configure failed!
exit /b 1
)
cmake --build qt\build --config Release
if errorlevel 1 (
echo ERROR: Build failed!
exit /b 1
)
echo.
echo ========================================
echo Step 3: Deploying Qt Dependencies
echo ========================================
"%QT_DIR%\bin\windeployqt.exe" --release --no-translations qt\build\CryptoMinerOptimizer.exe
if errorlevel 1 (
echo ERROR: windeployqt failed!
exit /b 1
)
echo.
echo ========================================
echo Step 4: Copying Web UI to Build
echo ========================================
if exist qt\build\web rmdir /s /q qt\build\web
xcopy dist qt\build\web /E /I /Y /Q
echo.
echo ========================================
echo Step 5: Creating Installer
echo ========================================
if not exist %INNO_SETUP% (
echo WARNING: Inno Setup not found at %INNO_SETUP%
echo Install it with: winget install --id JRSoftware.InnoSetup -e
echo Skipping installer creation...
goto :done
)
if not exist dist-installer mkdir dist-installer
%INNO_SETUP% installer\CryptoMinerOptimizer.iss
if errorlevel 1 (
echo ERROR: Installer creation failed!
exit /b 1
)
:done
echo.
echo ========================================
echo BUILD COMPLETE!
echo ========================================
echo.
echo Outputs:
echo - Executable: qt\build\CryptoMinerOptimizer.exe
echo - Installer: dist-installer\CryptoMinerOptimizer-Setup-1.0.0.exe
echo.
endlocal