2021-06-08 18:05:22 +00:00
|
|
|
@echo off
|
2023-09-23 11:25:22 +00:00
|
|
|
setlocal
|
2021-06-08 18:05:22 +00:00
|
|
|
|
2023-09-23 11:25:22 +00:00
|
|
|
where msbuild.exe 1>nul 2>&1 && goto :ready
|
2021-06-08 18:05:22 +00:00
|
|
|
|
2023-09-23 11:25:22 +00:00
|
|
|
set VSWHERE_PATH=%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe
|
|
|
|
if not exist "%VSWHERE_PATH%" set VSWHERE_PATH=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe
|
|
|
|
if not exist "%VSWHERE_PATH%" goto :error
|
|
|
|
for /f "usebackq delims=#" %%a in (`"%VSWHERE_PATH%" -latest -property installationPath`) do set VSDEVCMD_PATH=%%a\Common7\Tools\VsDevCmd.bat
|
|
|
|
if not exist "%VSDEVCMD_PATH%" goto :error
|
|
|
|
set VSCMD_SKIP_SENDTELEMETRY=1
|
|
|
|
call "%VSDEVCMD_PATH%" -no_logo -startdir=none
|
2021-06-08 18:05:22 +00:00
|
|
|
|
2023-09-23 11:25:22 +00:00
|
|
|
where msbuild.exe 1>nul 2>&1 && goto :ready
|
2021-06-08 18:05:22 +00:00
|
|
|
|
2023-09-23 11:25:22 +00:00
|
|
|
:error
|
|
|
|
|
|
|
|
echo Error: Can't find MSBuild.
|
|
|
|
exit /b 1
|
|
|
|
|
|
|
|
:ready
|
2021-06-08 18:05:22 +00:00
|
|
|
|
2020-08-02 15:32:36 +00:00
|
|
|
msbuild.exe %*
|