Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion scripts/vs-shell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ if($env:VSINSTALLDIR -eq $null) {
throw "Command not found: vswhere (did you install Visual Studio?)"
}

$vsDir = (& $vswhere -prerelease -latest -property installationPath)
# -products * is required to also match Build Tools installs, which vswhere
# skips by default (a machine with only Build Tools would fall through to the
# hardcoded 2022 paths and miss newer toolsets entirely). Require the C++
# toolset for the target arch so an install without it can't be selected.
$vcTools = if ($script:IsARM64) { "Microsoft.VisualStudio.Component.VC.Tools.ARM64" } else { "Microsoft.VisualStudio.Component.VC.Tools.x86.x64" }
$vsDir = (& $vswhere -products * -requires $vcTools -prerelease -latest -property installationPath)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
if ($vsDir -eq $null) {
# Check common VS installation paths
$searchPaths = @(
Expand Down