build_windows.bat 1.31 KB
@echo off
REM Windows Build Script for Gemini Image Generator

echo ================================
echo Building Gemini Image Generator
echo ================================

REM Check if virtual environment exists
if not exist ".venv" (
    echo Creating virtual environment...
    python -m venv .venv
)

REM Activate virtual environment
echo Activating virtual environment...
call .venv\Scripts\activate.bat

REM Install dependencies
echo Installing dependencies...
pip install --upgrade pip
pip install -r requirements.txt

REM Clean previous builds
echo Cleaning previous builds...
if exist "build" rd /s /q build
if exist "dist" rd /s /q dist
if exist "*.spec" del /q *.spec

REM Build executable
echo Building executable...
pyinstaller --name="ZB100ImageGenerator" ^
    --onedir ^
    --windowed ^
    --icon=zb100_windows.ico ^
    --add-data "config.json;." ^
    --add-data "zb100_windows.ico;." ^
    image_generator.py

REM Check if build was successful
if exist "dist\ZB100ImageGenerator\ZB100ImageGenerator.exe" (
    echo ================================
    echo Build successful!
    echo Executable: dist\ZB100ImageGenerator\ZB100ImageGenerator.exe
    echo ================================
) else (
    echo ================================
    echo Build failed!
    echo ================================
)

pause