bpo-30450: Don't use where, XP doesn't have it (GH-3348) · python/cpython@8905fb8 (original) (raw)

Original file line number Diff line number Diff line change
@@ -26,8 +26,8 @@
26 26 @set MSBUILD=
27 27
28 28 @rem If msbuild.exe is on the PATH, assume that the user wants that one.
29 -@where msbuild > "%TEMP%\msbuild.loc" 2> nul && set /P MSBUILD= < "%TEMP%\msbuild.loc" & del "%TEMP%\msbuild.loc"
30 -@if exist "%MSBUILD%" set MSBUILD="%MSBUILD%" & (set _Py_MSBuild_Source=PATH) & goto :found
29 +@msbuild /version > nul 2>&1
30 +@if NOT ERRORLEVEL 9009 set MSBUILD=msbuild & (set _Py_MSBuild_Source=PATH) & goto :found
31 31
32 32 @rem VS 2015 and earlier register MSBuild separately, so we can find it.
33 33 @rem Prefer MSBuild 14.0 over MSBuild 15.0, since the latter may not be able to find a VC14 install.