microsoft / vswhere

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

using `-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64` seem to work for Visual Studio Community but not BuildTools #320

Open LittleCoinCoin opened 14 hours ago

LittleCoinCoin commented 14 hours ago

Hello,

Components name specifications for C++ for BuildTools and Visual Studio Community both indicate that component ID Microsoft.VisualStudio.Component.VC.Tools.x86.x64 is available for install and, therefore, retrieval from vswhere.

Observed Behavior

  1. On a system that used Visual Studio Installer to get Community MSVC v143 - VS 2022 C++ x64/x86 BuildTools (latest version), running the command .\vswhere.exe -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 outputs information about the configuration as expected
  2. On a system that used Visual Studio Installer to get BuildTools MSVC v143 - VS 2022 C++ x64/x86 BuildTools (latest version), running the command .\vswhere.exe -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 DO NOT output anything.

Remark: other components that can be installed both on Community and BuildTools (e.g. windows SDK versions, Cmake tools, and so on) are apparently identical on both systems (i.e. same checkbox names were selected).

Expected Behaviour Case (2) should output the same information as case (1) (given that they use the same version of Visual Studio installer).

LittleCoinCoin commented 14 hours ago

As an additional comment, I have read the pinned issue #130 and the ones linked inside, but I thought their focus on products was different... 🤔

heaths commented 2 minutes ago

The product may not have the same component - the same ID, that is. You need to look at the catalog for components and you can pass -requiresAny to basically treat the list of -requires as an OR condition instead of an AND. Components may have different IDs if the team that owns them is trying to manage different "views" by composing different components for different products that may have more or fewer binaries in each workload.

You must pass -product * to search all products. #130 explains why Build Tools is not included and won't be. It would be breaking behavior. Just add -product * if you want to search for all products.