microsoft / php-sdk-binary-tools

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

Could not determine 'vc15' directory #66

Closed MartinKoeditz closed 4 years ago

MartinKoeditz commented 4 years ago

Hi,

when I'm invoking the command phpsdk-starter.bat -c vc15 -a x64 I get the error: Could not determine 'vc15' directory

I've done the steps as described in the section Basic usage example.

I'm using a Windows Terminal-Server and VS 2017 on x64 system.

Regards Martin

cmb69 commented 4 years ago

Hi Martin,

apparently this code fails to detect the VS installation.

Please try the vswhere commands manually, e.g. vswhere -nologo -version [15,16) -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath -format text. Don't they print any output?

Also you can check with 15 instead of the range [15,16).

MartinKoeditz commented 4 years ago

Hi,

actually I have a x86 installation of VS 2017. So this was my fault.

But phpsdk-starter.bat -c vc15 -a x86 throws the same error.

I invoked your command. I don't get any output.

cmb69 commented 4 years ago

Could you please post the full output of vswhere?

MartinKoeditz commented 4 years ago

Here is the output:

C:\Program Files (x86)\Microsoft Visual Studio\Installer>vswhere.exe
Visual Studio Locator version 2.4.1+g2035d08a45 [query version 1.16.1163.30317]
Copyright (C) Microsoft Corporation. All rights reserved.

instanceId: 6bf81498
installDate: 15.06.2018 18:54:44
installationName: VisualStudio/15.7.3+27703.2026
installationPath: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community
installationVersion: 15.7.27703.2026
productId: Microsoft.VisualStudio.Product.Community
productPath: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe
isPrerelease: 0
displayName: Visual Studio Community 2017
description: Kostenlose, voll funktionsfähige IDE für Studenten, Open Source- und einzelne Entwickler.
channelId: VisualStudio.15.Release
channelUri: https://aka.ms/vs/15/release/channel
enginePath: C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service
releaseNotes: https://go.microsoft.com/fwlink/?LinkId=660692#15.7.3
thirdPartyNotices: https://go.microsoft.com/fwlink/?LinkId=660708
updateDate: 2018-06-15T16:54:44.8573243Z
catalog_buildBranch: d15.7
catalog_buildVersion: 15.7.27703.2026
catalog_id: VisualStudio/15.7.3+27703.2026
catalog_localBuild: build-lab
catalog_manifestName: VisualStudio
catalog_manifestType: installer
catalog_productDisplayVersion: 15.7.3
catalog_productLine: Dev15
catalog_productLineVersion: 2017
catalog_productMilestone: RTW
catalog_productMilestoneIsPreRelease: False
catalog_productName: Visual Studio
catalog_productPatchVersion: 3
catalog_productPreReleaseMilestoneSuffix: 1.0
catalog_productRelease: RTW
catalog_productSemanticVersion: 15.7.3+27703.2026
catalog_requiredEngineVersion: 1.16.1187.57215
properties_campaignId: 688392304.1521228867
properties_channelManifestId: VisualStudio.15.Release/15.7.3+27703.2026
properties_nickname:
properties_setupEngineFilePath: C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installershell.exe
cmb69 commented 4 years ago

Thanks! Seems you've checked out an old SDK version. I suggest you do git checkout php-sdk-2.2.0.

MartinKoeditz commented 4 years ago

Changed branch:

c:\php-sdk>git checkout php-sdk-2.2.0
HEAD is now at cb51b8f Prepare 2.2.0

Invoked command:

c:\php-sdk>phpsdk-vc15-x86.bat
Could not determine 'vc15' directory

Maybe this can help:

c:\php-sdk>vswhere
Der Befehl "vswhere" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

Seems the VS command prompt is unable to find the vswhere command.

cmb69 commented 4 years ago

Seems the VS command prompt is unable to find the vswhere command.

Hmm, usually you don't use the VS command prompt for the PHP SDK. Instead use a vanilla cmd.exe. vswhere is in the bin folder of the SDK, so bin\vswhere should work.

MartinKoeditz commented 4 years ago

Ah, OK. But I still get the same output with vanilla cmd.exe:

c:\php-sdk>bin\vswhere.exe
Visual Studio Locator version 2.6.7+91f4c1d09e [query version 1.16.1163.30317]
Copyright (C) Microsoft Corporation. All rights reserved.

instanceId: 6bf81498
installDate: 15.06.2018 18:54:44
installationName: VisualStudio/15.7.3+27703.2026
installationPath: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community
installationVersion: 15.7.27703.2026
productId: Microsoft.VisualStudio.Product.Community
productPath: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe
state: 4294967295
isComplete: 1
isLaunchable: 1
isPrerelease: 0
isRebootRequired: 0
displayName: Visual Studio Community 2017
description: Kostenlose, voll funktionsfähige IDE für Studenten, Open Source- und einzelne Entwickler.
channelId: VisualStudio.15.Release
channelUri: https://aka.ms/vs/15/release/channel
enginePath: C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service
releaseNotes: https://go.microsoft.com/fwlink/?LinkId=660692#15.7.3
thirdPartyNotices: https://go.microsoft.com/fwlink/?LinkId=660708
updateDate: 2018-06-15T16:54:44.8573243Z
catalog_buildBranch: d15.7
catalog_buildVersion: 15.7.27703.2026
catalog_id: VisualStudio/15.7.3+27703.2026
catalog_localBuild: build-lab
catalog_manifestName: VisualStudio
catalog_manifestType: installer
catalog_productDisplayVersion: 15.7.3
catalog_productLine: Dev15
catalog_productLineVersion: 2017
catalog_productMilestone: RTW
catalog_productMilestoneIsPreRelease: False
catalog_productName: Visual Studio
catalog_productPatchVersion: 3
catalog_productPreReleaseMilestoneSuffix: 1.0
catalog_productRelease: RTW
catalog_productSemanticVersion: 15.7.3+27703.2026
catalog_requiredEngineVersion: 1.16.1187.57215
properties_campaignId: 688392304.1521228867
properties_channelManifestId: VisualStudio.15.Release/15.7.3+27703.2026
properties_nickname:
properties_setupEngineFilePath: C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installershell.exe

And:

c:\php-sdk>phpsdk-vc15-x86.bat
Could not determine 'vc15' directory
cmb69 commented 4 years ago

Then please try bin\vswhere -nologo -version [15,16) -property installationPath -format text. If that does report the installationPath, you did not have the Microsoft.VisualStudio.Component.VC.Tools.x86.x64 component installed, and need to update your VS installation.

MartinKoeditz commented 4 years ago

Now I got:

c:\php-sdk>bin\vswhere -nologo -version [15,16) -property installationPath -format text
installationPath: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community

I will update my VS and report again.

Thank you.

MartinKoeditz commented 4 years ago

I updated my VS 2017 but still get the same errors. What is your preferred VS version? Where can I get this? Maybe there are some incompatibilities.

cmb69 commented 4 years ago

The VS variant (e.g. Enterprise, Community, etc.) shouldn't really matter. It is important, though, that you have the C++ desktop development tools installed; something like: vs-install

MartinKoeditz commented 4 years ago

Thank you. After updating the environment everything works fine. So the problem was on my side.

tyonly commented 2 years ago

yes, Following the steps, I also solved the problem