From a2e3107266a6101c5b9cd888e641612371e08096 Mon Sep 17 00:00:00 2001 From: cchangwen <157893811+cchangwen@users.noreply.github.com> Date: Sat, 21 Sep 2024 09:51:00 +0800 Subject: [PATCH] Give users a chance to Input the path of `BuildTools\VC` vswhere.exe return nothing If there is no complete installation of Visual Studio https://visualstudio.microsoft.com/visual-cpp-build-tools/ --- bin/phpsdk_setshell.bat | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/phpsdk_setshell.bat b/bin/phpsdk_setshell.bat index 8c41734..a5c8e65 100755 --- a/bin/phpsdk_setshell.bat +++ b/bin/phpsdk_setshell.bat @@ -136,6 +136,10 @@ if 15 gtr %PHP_SDK_VS_NUM% ( for /f "tokens=1* delims=: " %%a in ('%~dp0\vswhere -nologo !VS_VERSION_ARGS! -prerelease -requires Microsoft.VisualStudio.Component.VC.Tools.!APPEND! -property installationPath -format text') do ( set PHP_SDK_VC_DIR=%%b\VC ) + if not exist "!PHP_SDK_VC_DIR!" ( + echo Could not determine '%PHP_SDK_VS%' directory + set /p PHP_SDK_VC_DIR=Input '%PHP_SDK_VS%' directory: + ) if not exist "!PHP_SDK_VC_DIR!" ( echo Could not determine '%PHP_SDK_VS%' directory goto out_error;