#!/bin/bash set -e echo "=========================================" echo " RFCP Desktop Build (Windows)" echo "=========================================" cd "$(dirname "$0")/.." # 1. Build frontend echo "[1/4] Building frontend..." cd frontend npm ci npm run build cd .. # 2. Build backend with PyInstaller echo "[2/4] Building backend..." cd backend python -m pip install -r requirements.txt python -m pip install pyinstaller cd ../installer python -m PyInstaller rfcp-server.spec --clean --noconfirm mkdir -p ../desktop/backend-dist/win cp dist/rfcp-server.exe ../desktop/backend-dist/win/ cd .. # 3. Build Electron app echo "[3/4] Building Electron app..." cd desktop npm ci npm run build:win cd .. # 4. Done echo "[4/4] Build complete!" echo "" echo "Output: desktop/dist/" ls -la desktop/dist/*.exe 2>/dev/null || echo "Build artifacts in desktop/dist/"