-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_windows.bat
More file actions
44 lines (37 loc) · 1.31 KB
/
build_windows.bat
File metadata and controls
44 lines (37 loc) · 1.31 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
@echo off
REM build_windows.bat - Create a single-file TestBuddy.exe and (optionally) compile NSIS installer
REM Usage: run from project root in an elevated PowerShell/Command Prompt with the venv activated
SETLOCAL
REM Activate venv if present
if exist ".venv\Scripts\activate.bat" (
call ".venv\Scripts\activate.bat"
) else (
echo Warning: virtualenv not found at .venv\Scripts\activate.bat. Ensure dependencies are installed.
)
REM Ensure PyInstaller is installed
python -m pip install --upgrade pip
python -m pip install pyinstaller
REM Build the executable
REM Output to ./dist to match packaging expectations
pyinstaller --noconfirm --onefile --windowed --name TestBuddy --icon icon.ico --distpath dist app.py
IF ERRORLEVEL 1 (
echo PyInstaller failed. See output above.
exit /b 1
)
REM If NSIS (makensis) is available, compile the installer
where makensis >nul 2>&1
if %ERRORLEVEL%==0 (
echo Found makensis, compiling NSIS installer...
makensis testbuddy_installer.nsi
if ERRORLEVEL 1 (
echo NSIS failed to compile the installer.
) else (
echo NSIS installer created successfully.
)
) else (
echo makensis (NSIS) not found in PATH - skipping installer compilation.
echo You can install NSIS and re-run this script to create the installer.
)
echo Build complete. Output folder: %CD%\dist
ENDLOCAL
pause