This commit is contained in:
Anatol Belski 2019-03-31 13:05:27 +02:00
Родитель 76ede8f900
Коммит 8b957129bd
1 изменённых файлов: 15 добавлений и 3 удалений

Просмотреть файл

@ -82,12 +82,24 @@ if 15 gtr %PHP_SDK_VS_NUM% (
for /f "tokens=2*" %%a in ('reg query !TMPKEY! /v ProductDir') do set PHP_SDK_VS_DIR=%%b
) else (
rem vc15 support only for now, could parse out and pass on later
for /f "tokens=1* delims=: " %%a in ('%~dp0\vswhere -nologo -version %PHP_SDK_VS_NUM% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath -format text') do set PHP_SDK_VS_DIR=%%b\VC
for /f "tokens=1* delims=: " %%a in ('%~dp0\vswhere -nologo -version %PHP_SDK_VS_NUM% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath -format text') do (
set PHP_SDK_VS_DIR=%%b\VC
goto break0
)
:break0
if not exist "!PHP_SDK_VS_DIR!" (
for /f "tokens=1* delims=: " %%a in ('%~dp0\vswhere -nologo -version %PHP_SDK_VS_NUM% -products Microsoft.VisualStudio.Product.BuildTools -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath -format text') do set PHP_SDK_VS_DIR=%%b\VC
for /f "tokens=1* delims=: " %%a in ('%~dp0\vswhere -nologo -version %PHP_SDK_VS_NUM% -products Microsoft.VisualStudio.Product.BuildTools -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath -format text') do (
set PHP_SDK_VS_DIR=%%b\VC
goto break1
)
:break1
if not exist "!PHP_SDK_VS_DIR!" (
rem check for a preview release
for /f "tokens=1* delims=: " %%a in ('%~dp0\vswhere -nologo -version %PHP_SDK_VS_NUM% -prerelease -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath -format text') do set PHP_SDK_VS_DIR=%%b\VC
for /f "tokens=1* delims=: " %%a in ('%~dp0\vswhere -nologo -version %PHP_SDK_VS_NUM% -prerelease -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath -format text') do (
set PHP_SDK_VS_DIR=%%b\VC
goto break3
)
:break3
if not exist "!PHP_SDK_VS_DIR!" (
echo Could not determine '%PHP_SDK_VS%' directory
goto out_error;