@echo off REM Build dsh-launcher.exe for Windows (amd64). REM REM Usage: scripts\build-windows.bat REM REM Prerequisites on Windows: REM - Go 1.21+ https://go.dev/dl/ REM - Node.js 18+ https://nodejs.org/ REM - Wails CLI go install github.com/wailsapp/wails/v2/cmd/wails@latest REM - WebView2 Runtime Win10 1803+ ships it, else https://aka.ms/webview2 REM - MSVC build tools https://visualstudio.microsoft.com/downloads/ (Build Tools, "Desktop development with C++") REM REM Note: Wails v2 Windows build needs MSVC toolchain (cgo for webview2 loader). REM Cannot cross-compile .exe from macOS / Linux. REM REM Output: build\bin\dsh-launcher.exe setlocal enabledelayedexpansion cd /d "%~dp0\.." echo ^>^> dsh-launcher Windows build echo. REM 1. Tool check where go >nul 2>nul if errorlevel 1 ( echo [X] go not installed exit /b 1 ) where node >nul 2>nul if errorlevel 1 ( echo [X] node not installed exit /b 1 ) where npm >nul 2>nul if errorlevel 1 ( echo [X] npm not installed exit /b 1 ) where wails >nul 2>nul if errorlevel 1 ( echo [X] wails CLI not installed - run: go install github.com/wailsapp/wails/v2/cmd/wails@latest exit /b 1 ) REM 2. Must run on Windows if not "%OS%"=="Windows_NT" ( echo [X] must run on Windows, current: %OS% exit /b 1 ) REM 3. Sync frontend deps echo ^>^> npm install cd frontend call npm install if errorlevel 1 ( echo [X] npm install failed exit /b 1 ) cd .. REM 4. Build echo. echo ^>^> wails build wails build -clean -platform windows/amd64 if errorlevel 1 ( echo [X] wails build failed exit /b 1 ) REM 5. Verify set EXE=build\bin\dsh-launcher.exe if not exist "%EXE%" ( echo [X] %EXE% not found exit /b 1 ) echo. echo [OK] exe: %EXE% echo run: %EXE% echo build dir: build\bin\ echo. endlocal