From 04cc50669cd1c1603c510cfc4a88ad588458a843 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Thu, 16 Dec 2021 11:06:08 +0100 Subject: [PATCH] provisioning: Make sure that MSVC 2019 version is added to versions.txt If MSVC 2022 is installed in CI machines, vswhere -latest without any additional version information will return the latest version of 2022. By limiting the version range (>=16, <17) we make sure that only the latest version of MSVC 2019 is returned. Change-Id: I8f92099f030660c1914ffb728efc9a55eadf4808 Reviewed-by: Heikki Halmet (cherry picked from commit 37f4d821b82b69e693cd460aecd5b06995be0e44) Reviewed-by: Qt Cherry-pick Bot --- coin/provisioning/common/windows/update-msvc2019.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/coin/provisioning/common/windows/update-msvc2019.ps1 b/coin/provisioning/common/windows/update-msvc2019.ps1 index 2de34e96..da68cf75 100644 --- a/coin/provisioning/common/windows/update-msvc2019.ps1 +++ b/coin/provisioning/common/windows/update-msvc2019.ps1 @@ -76,7 +76,8 @@ function Install { Install $urlOfficial_vsInstaller $urlCache_vsInstaller $sha1_vsInstaller # Install $urlOfficial_buildToolsInstaller $urlCache_buildToolsInstaller $sha1_buildToolsInstaller -$msvc2019Version = (cmd /c "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property catalog_productDisplayVersion 2`>`&1) +$msvc2019Version = (cmd /c "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" ` + -version [16.0,17.0`) -latest -property catalog_productDisplayVersion 2`>`&1) Write-Output "Visual Studio 2019 = $msvc2019Version" >> ~\versions.txt Write-Output "Visual Studio 2019 Build Tools = $version" >> ~\versions.txt