From e571e4fa228a8a15f629280d6f50d9e2133e95e0 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Tue, 28 Jan 2025 15:33:50 -0600 Subject: [PATCH] build: change how we find the latest VC tools version (#18468) 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. (cherry picked from commit 8e4da6e938430e11535e444032cfa2c32a6ab1a2) Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgWyLAQ Service-Version: 1.22 --- build/scripts/Set-LatestVCToolsVersion.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/scripts/Set-LatestVCToolsVersion.ps1 b/build/scripts/Set-LatestVCToolsVersion.ps1 index 54a43b3a01f..3156fff1bc5 100644 --- a/build/scripts/Set-LatestVCToolsVersion.ps1 +++ b/build/scripts/Set-LatestVCToolsVersion.ps1 @@ -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"