diff --git a/Dist/BuildAndPackage.bat b/Dist/BuildAndPackage.bat index 616b39d95a..8884698994 100644 --- a/Dist/BuildAndPackage.bat +++ b/Dist/BuildAndPackage.bat @@ -9,15 +9,11 @@ if "%1"=="" ( git --version > NUL @if errorlevel 1 goto MISSINGGIT -reg query "HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0" /v MSBuildToolsPath > nul 2>&1 -if ERRORLEVEL 1 goto MISSINGMSBUILD +for /f "usebackq tokens=*" %%A in (`vswhere -version "[16.0,17.0)" -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe`) do SET MSBUILDPATH=%%A -for /f "skip=2 tokens=2,*" %%A in ('reg.exe query "HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0" /v MSBuildToolsPath') do SET MSBUILDDIR=%%B +IF "%MSBUILDPATH%"=="" GOTO MISSINGMSBUILD -IF NOT EXIST %MSBUILDDIR%nul goto MISSINGMSBUILD -IF NOT EXIST %MSBUILDDIR%msbuild.exe goto MISSINGMSBUILD - -call "%MSBUILDDIR%msbuild.exe" ..\BizHawk.sln /p:Configuration=Release /p:Platform="Any Cpu" /t:rebuild +call "%MSBUILDPATH%" ..\BizHawk.sln /p:Configuration=Release /p:Platform="Any Cpu" /t:rebuild @if errorlevel 1 goto MSBUILDFAILED diff --git a/Dist/vswhere.exe b/Dist/vswhere.exe new file mode 100644 index 0000000000..582e82868d Binary files /dev/null and b/Dist/vswhere.exe differ