microsoft / php-sdk-binary-tools

Tool kit for building PHP under Windows
BSD 2-Clause "Simplified" License
271 stars 78 forks source link

Be more strict when looking for the desired VS #56

Closed cmb69 closed 5 years ago

cmb69 commented 5 years ago

On systems where VS 2017 and VS 2019 are available, the starter script may choose VS 2019 if vc15 is requested. The documentation on vswhere isn't particularly clear regarding the -version parameter, but it states that a version range is expected. Therefore we change the shell setup script accordingly.

cmb69 commented 5 years ago

Example session on my machine:

D:\php-sdk\bin>vswhere -nologo -version 15 -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath -format text
installationPath: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community

installationPath: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community

D:\php-sdk\bin>vswhere -nologo -version [15,16) -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath -format text
installationPath: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community
msftclas commented 5 years ago

CLA assistant check
All CLA requirements met.