# Build script for Windows static linking # Run this in PowerShell before building Write-Host "Setting up environment for static build..." -ForegroundColor Green # Set vcpkg environment $env:VCPKG_ROOT = "C:\vcpkg" $env:VCPKGRS_DYNAMIC = "0" # Verify vcpkg is installed if (-not (Test-Path "C:\vcpkg\vcpkg.exe")) { Write-Host "vcpkg not found at C:\vcpkg" -ForegroundColor Red Write-Host "Install with:" -ForegroundColor Yellow Write-Host " git clone https://github.com/Microsoft/vcpkg.git C:\vcpkg" -ForegroundColor Cyan Write-Host " C:\vcpkg\bootstrap-vcpkg.bat" -ForegroundColor Cyan exit 1 } # Check for static libraries $libs = @("tesseract", "leptonica") foreach ($lib in $libs) { $installed = C:\vcpkg\vcpkg list | Select-String $lib if (-not $installed) { Write-Host "$lib not installed. Installing..." -ForegroundColor Yellow Write-Host "This may take 30+ minutes..." -ForegroundColor Yellow C:\vcpkg\vcpkg install "${lib}:x64-windows-static-md" } } Write-Host "Environment configured for static build!" -ForegroundColor Green Write-Host "Run: npm run tauri-build" -ForegroundColor Cyan