Give users a chance to Input the path of BuildTools\VC#31
Conversation
vswhere.exe return nothing If there is no complete installation of Visual Studio https://visualstudio.microsoft.com/visual-cpp-build-tools/
|
That worked fine for me a couple of years ago (see https://gist.github.com/cmb69/47b8c7fb392f5d79b245c74ac496632c). Is it possible that you have the build tools for vs 17 installed (plus the MSVC v142 tools), but want to build for vs16? This is supported if you call |
|
@cmb69 Just as you said. |
|
In some cases, |
|
Yes, this is a known issue. That part of detection is super strict and uses a range, to avoid finding another Visual Studio installation; this is important if you have multiple versions of Visual Studio installed. See also #29. While offering the possibility to input the path manually (i.e. this PR) is certainly an option, I prefer to apply a local patch for easy of use (I start the php-sdk environments usually quite often). Patch phpsdk-vc15-x64.bat | 2 +-
phpsdk-vc15-x86.bat | 2 +-
phpsdk-vs16-x64.bat | 2 +-
phpsdk-vs16-x86.bat | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/phpsdk-vc15-x64.bat b/phpsdk-vc15-x64.bat
index 5988bdb..12247b3 100755
--- a/phpsdk-vc15-x64.bat
+++ b/phpsdk-vc15-x64.bat
@@ -1,6 +1,6 @@
@echo off
-call %~dp0phpsdk-starter.bat -c vc15 -a x64 %*
+call %~dp0phpsdk-starter.bat -c vc15 -a x64 -s 14.16 %*
exit /b %ERRORLEVEL%
diff --git a/phpsdk-vc15-x86.bat b/phpsdk-vc15-x86.bat
index 3721abe..468cbaf 100755
--- a/phpsdk-vc15-x86.bat
+++ b/phpsdk-vc15-x86.bat
@@ -1,6 +1,6 @@
@echo off
-call %~dp0phpsdk-starter.bat -c vc15 -a x86 %*
+call %~dp0phpsdk-starter.bat -c vc15 -a x86 -s 14.16 %*
exit /b %ERRORLEVEL%
diff --git a/phpsdk-vs16-x64.bat b/phpsdk-vs16-x64.bat
index c0c58e4..07a1652 100755
--- a/phpsdk-vs16-x64.bat
+++ b/phpsdk-vs16-x64.bat
@@ -1,6 +1,6 @@
@echo off
-call %~dp0phpsdk-starter.bat -c vs16 -a x64 %*
+call %~dp0phpsdk-starter.bat -c vs16 -a x64 -s 14.29 %*
exit /b %ERRORLEVEL%
diff --git a/phpsdk-vs16-x86.bat b/phpsdk-vs16-x86.bat
index 5162e0a..d6f07f6 100755
--- a/phpsdk-vs16-x86.bat
+++ b/phpsdk-vs16-x86.bat
@@ -1,6 +1,6 @@
@echo off
-call %~dp0phpsdk-starter.bat -c vs16 -a x86 %*
+call %~dp0phpsdk-starter.bat -c vs16 -a x86 -s 14.29 %*
exit /b %ERRORLEVEL% |
|
Thanks for the PR. We should avoid an interactive set /p fallback here because unattended builds and CI jobs may hang indefinitely when Visual Studio detection fails. Pure Build Tools installations are already supported since 7cc9c62, and selecting an older toolset installed in a newer Visual Studio installation is supported with the -s option since d1036b5. Since that covers the reported setup without introducing an interactive CI path, I’m closing this. If manual path is still needed, it should be a non-interactive CLI option or environment variable. |
vswhere.exe return nothing If there is no complete installation of Visual Studio https://visualstudio.microsoft.com/visual-cpp-build-tools/