@echo off chcp 65001 >nul setlocal enabledelayedexpansion echo ============================================ echo Service Party App - Windows Build Script echo ============================================ echo. cd /d "%~dp0" :: Check Node.js where node >nul 2>nul if %errorlevel% neq 0 ( echo [ERROR] Node.js not found. Please install Node.js 18+ echo Download: https://nodejs.org/ goto :error ) :: Check Go where go >nul 2>nul if %errorlevel% neq 0 ( echo [ERROR] Go not found. Please install Go 1.21+ echo Download: https://go.dev/dl/ goto :error ) :: Show versions echo [INFO] Node.js version: node --version echo [INFO] Go version: go version echo. :: Step 1: Build TSS subprocess echo ============================================ echo [1/4] Building TSS subprocess (Go)... echo ============================================ cd tss-party if not exist "..\bin\win32-x64" mkdir "..\bin\win32-x64" echo Building tss-party.exe... go build -ldflags="-s -w" -o ..\bin\win32-x64\tss-party.exe . if %errorlevel% neq 0 ( echo [ERROR] TSS subprocess build failed goto :error ) echo [OK] tss-party.exe created cd .. echo. :: Step 2: Install dependencies echo ============================================ echo [2/4] Installing npm dependencies... echo ============================================ if exist "node_modules" ( echo Dependencies exist, skipping install ) else ( call npm install if %errorlevel% neq 0 ( echo [ERROR] npm install failed goto :error ) ) echo [OK] Dependencies installed echo. :: Step 3: Check resources echo ============================================ echo [3/4] Checking resources... echo ============================================ if not exist "build" mkdir "build" if not exist "build\icon.ico" echo [WARN] build\icon.ico not found, using default icon echo. :: Step 4: Build Electron app echo ============================================ echo [4/4] Building Windows application... echo ============================================ echo Building frontend code... call npm run build:win if %errorlevel% neq 0 ( echo [ERROR] Application build failed goto :error ) echo. echo ============================================ echo Build Complete! echo ============================================ echo. echo Output directory: %cd%\release\ echo. :: List generated files if exist "release" ( echo Generated files: dir /b release\*.exe 2>nul ) echo. echo Press any key to exit... pause >nul exit /b 0 :error echo. echo Build failed. Please check error messages. echo. pause exit /b 1