Skip to content

Commit

Permalink
build: change how we find the latest VC tools version (#18468)
Browse files Browse the repository at this point in the history
Apparently, we were using the package containing the CRT _source code_
to determine the version of the tools.

Also apparently, VS does not guarantee that that package has the same
version as the tools package.

We should use the version of the tools package instead.
  • Loading branch information
DHowett authored Jan 28, 2025
1 parent 1040035 commit 8e4da6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion build/scripts/Set-LatestVCToolsVersion.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$VSInstances = ([xml](& 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -include packages -format xml))
$VSPackages = $VSInstances.instances.instance.packages.package
$LatestVCPackage = ($VSInstances.instances.instance.packages.package | ? { $_.id -eq "Microsoft.VisualCpp.CRT.Source" })
$LatestVCPackage = ($VSInstances.instances.instance.packages.package | ? { $_.id -eq "Microsoft.VisualCpp.Tools.Core" })
$LatestVCToolsVersion = $LatestVCPackage.version;

Write-Output "Latest VCToolsVersion: $LatestVCToolsVersion"
Expand Down

0 comments on commit 8e4da6e

Please sign in to comment.