microsoft / vswhere

Locate Visual Studio 2017 and newer installations
MIT License
923 stars 98 forks source link

`-requires` wildcard #276

Closed ryanmkurtz closed 1 year ago

ryanmkurtz commented 2 years ago

I would like to do something like -requires Microsoft.VisualStudio.Component.Windows10SDK.*, or something similar so I don't have to maintain a list of all possible SDK versions when any will suffice. Is that possible?

heaths commented 2 years ago

I'm not opposed to the idea - we could keep it efficient by only doing a wildcard match if there are wildcard characters in the filter - but why not just depend on the parent Workload then? IIRC, at least one Windows SDK is required so if you don't care which version this should be equivalent.

ryanmkurtz commented 2 years ago

but why not just depend on the parent Workload then?

Are you referring to Microsoft.VisualStudio.Workload.UniversalBuildTools?

heaths commented 2 years ago

There's a couple, but that one is probably best if you just want a Windows SDK.

ryanmkurtz commented 2 years ago

In my experimentation it's possible to install studio or build tools with no SDK, and there are many components that full under Microsoft.VisualStudio.Workload.UniversalBuildTools that don't fulfill my Win10 or Win11 SDK requirement, so I think a wildcard or regex would still be needed.

heaths commented 1 year ago

This feature is included in 3.1.1 which is available on nuget.org, chocolatey.org, and should soon be available in scoop.

heaths commented 1 year ago

I've also added this to the wiki: https://github.com/microsoft/vswhere/wiki/Examples#wildcards

ryanmkurtz commented 1 year ago

Thank you!

neur1n commented 1 year ago

When running vswhere -requires Microsoft.VisualStudio.Component.Windows10SDK.*, why am I getting the following results instead of the installation location of Windows SDK (which should be D:\Windows Kits\10)?

Visual Studio Locator version 3.1.1+f4ef329670 [query version 2.11.65.22356]
Copyright (C) Microsoft Corporation. All rights reserved.

instanceId: 32e62fb6
installDate: 5/26/2022 16:08:27
installationName: VisualStudio/16.11.23+33214.272
installationPath: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
installationVersion: 16.11.33214.272
productId: Microsoft.VisualStudio.Product.Community
productPath: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe
state: 4294967295
isComplete: 1
isLaunchable: 1
isPrerelease: 0
isRebootRequired: 0
thirdPartyNotices: https://go.microsoft.com/fwlink/?LinkId=660909
updateDate: 2023-01-12T08:50:11.3291813Z
catalog_buildBranch: d16.11
catalog_buildVersion: 16.11.33214.272
catalog_id: VisualStudio/16.11.23+33214.272
catalog_localBuild: build-lab
catalog_manifestName: VisualStudio
catalog_manifestType: installer
catalog_productDisplayVersion: 16.11.23
catalog_productLine: Dev16
catalog_productLineVersion: 2019
catalog_productMilestone: RTW
catalog_productMilestoneIsPreRelease: False
catalog_productName: Visual Studio
catalog_productPatchVersion: 23
catalog_productPreReleaseMilestoneSuffix: 1.0
catalog_productSemanticVersion: 16.11.23+33214.272
catalog_requiredEngineVersion: 2.11.69.53063
properties_campaignId: 2030:68786c65-beca-44df-bab1-d1f58a781f07
properties_channelManifestId: VisualStudio.16.Release/16.11.23+33214.272
properties_nickname:
properties_setupEngineFilePath: C:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe
heaths commented 1 year ago

vswhere is for finding the location of VS, not individual package information which can have numerous top-level directories, such as Windows Kits. With the returned installation path you have to construct your own child path. Anything installed outside the VS installation path is most likely a Windows Installer package and you can use other existing means to detect if and where they are installed.

In the future, please open a new issue.