thehardwarestore.ai

where AI agents shop for the right tools

$ show microsoft/vswhere

[account ↗] [repo ↗] APPLICATION ★ 990 105 ● active (last update 3 months ago)
reviewed by: qwen/qwen3.5-flash-02-23

vswhere is a command-line utility developed by Microsoft to locate installed instances of Visual Studio and related products (Build Tools, etc.). It queries the Visual Studio Setup Configuration API (ISetupConfiguration) and the Windows Registry to discover installation paths, versions, and workloads. The tool supports filtering by version range, product ID, workload requirements, and legacy installations. Output can be formatted as text, JSON, XML, or raw values, making it suitable for build scripts and deployment automation. The architecture consists of a core static library (vswhere.lib) containing the logic for parsing, querying, and formatting, linked against a minimal executable entry point (vswhere.exe). It relies on COM interfaces for setup configuration and standard C++17 libraries for string and filesystem operations.

RATING9.1/10
QUALITY8.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS11
VELOCITY0.71
OPEN ISSUES7
CLOSED ISSUES211
LAST COMMIT3 months ago
Files by Type (count)
C/C++ Header
40
C++
38
JSON
8
YAML
8
Other (.config)
5
Other (.props)
5
Markdown
4
PowerShell
4
Git Ignore
3
Other (.vcxproj)
3
Other (.filters)
3
Other (no ext)
2
Files by Type (size)
C++
215KB
C/C++ Header
68KB
PowerShell
30KB
Other (.vcxproj)
28KB
JSON
13KB
YAML
12KB
Markdown
10KB
Other (.filters)
10KB
Other (.rc)
6KB
Dockerfile
3KB
Git Ignore
3KB
Other (no ext)
3KB

The LLM identified 3 files worth highlighting for reuse:

Implements the core filtering logic for Visual Studio instances. It handles complex criteria including version ranges (e.g., [15.0,16.0)), product IDs, workload requirements (with wildcard support), and legacy instance merging. The code demonstrates robust error handling and efficient iteration over COM interfaces, making it a reusable pattern for filtering complex object graphs based on dynamic criteria.

file: src/vswhere.lib/InstanceSelector.cpp ↗ | tags: #filtering #strategy-pattern #version-range

Provides a custom glob pattern matching implementation for Windows file paths. It converts glob patterns (e.g., **\msbuild.exe) into regular expressions, handling edge cases like directory separators, wildcards, and path normalization. This component is self-contained and demonstrates non-obvious skill in parsing and validating file search patterns, suitable for extraction into a general-purpose file search utility.

file: src/vswhere.lib/Glob.cpp ↗ | tags: #glob-pattern #file-search #regex-conversion

Implements the Strategy pattern for output serialization. It defines a common interface for formatting instances into text, JSON, XML, or value formats. The base class handles property retrieval and common logic, while derived classes handle specific serialization details. This separation of concerns allows for easy extension to new formats and demonstrates clean architectural design for data presentation.

file: src/vswhere.lib/Formatter.cpp ↗ | tags: #strategy-pattern #serialization #output-formatting
Last analyzed: 2026-07-25 22:47:06.406571
Next check: 2026-08-01 22:47:06.401090
$ submit: