@echo off setlocal rem Usage: build.cmd [Debug|Release] (default Debug, x64) set "CONFIG=%~1" if "%CONFIG%"=="" set "CONFIG=Debug" for /f "usebackq delims=" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe`) do set "MSBUILD=%%i" if not defined MSBUILD ( echo MSBuild not found. Please install Visual Studio 2022 C++ workload. exit /b 1 ) powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0third_party\prepare.ps1" -Configuration %CONFIG% if errorlevel 1 exit /b 1 "%MSBUILD%" "%~dp0TTDownloader.sln" -p:Configuration=%CONFIG% -p:Platform=x64 -p:PlatformToolset=v143 -m -v:minimal set "BUILD_EXIT_CODE=%ERRORLEVEL%" if "%BUILD_EXIT_CODE%"=="0" copy /y "%~dp0third_party\NOTICES.txt" "%~dp0client\bin\THIRD-PARTY-NOTICES.txt" >nul endlocal & exit /b %BUILD_EXIT_CODE%