diff options
author | Pavel Dubsky <pavel.dubsky@qt.io> | 2023-03-07 14:35:24 +0100 |
---|---|---|
committer | Pavel Dubsky <pavel.dubsky@qt.io> | 2023-03-12 15:59:15 +0000 |
commit | f58afd5476ab6695961ef127da4427371004723c (patch) | |
tree | c65bb4e4cc034585dfbe8396683d162825a50269 | |
parent | 8b12598bf832f1a0106ecef3d96e7ba1ef09ecb3 (diff) | |
download | qt5-f58afd5476ab6695961ef127da4427371004723c.tar.gz |
Use vswhere to find the location of Visual Studio
vswhere tool is included since Visual Studio 2017 and is always located
at the same path thus making it a more convenient way to find Visual
Studio install directory.
Pick-to: 6.5
Change-Id: I680af8f88779841108b436223b4667f8a7c91aba
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
-rw-r--r-- | coin/provisioning/common/windows/helpers.ps1 | 9 | ||||
-rw-r--r-- | coin/provisioning/common/windows/install-ffmpeg.ps1 | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/coin/provisioning/common/windows/helpers.ps1 b/coin/provisioning/common/windows/helpers.ps1 index 1967b02a..d27b2fd6 100644 --- a/coin/provisioning/common/windows/helpers.ps1 +++ b/coin/provisioning/common/windows/helpers.ps1 @@ -274,3 +274,12 @@ function DeleteSchedulerTask { Write-Host "Disabling $Task from Task Scheduler" SCHTASKS /DELETE /TN "Microsoft\Windows\$Task" /F } + +function GetVSPath { + Param ( + [string]$VSWhere = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe", + [string]$Component = "Microsoft.VisualStudio.Component.VC.Tools.x86.x64" + ) + + return (& $VSWhere -nologo -latest -products * -requires $Component -property installationPath) +} diff --git a/coin/provisioning/common/windows/install-ffmpeg.ps1 b/coin/provisioning/common/windows/install-ffmpeg.ps1 index 42fb26d2..3bca2520 100644 --- a/coin/provisioning/common/windows/install-ffmpeg.ps1 +++ b/coin/provisioning/common/windows/install-ffmpeg.ps1 @@ -107,8 +107,7 @@ function InstallMingwFfmpeg { function InstallMsvcFfmpeg { - $vsPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional" - #$vsPath = "C:\Program Files\Microsoft Visual Studio\2022\Professional" + $vsPath = GetVSPath Write-Host "Enter VisualStudio developer shell" try { |