From f904b88387f7dc41ab540f0c032519460094d3fc Mon Sep 17 00:00:00 2001 From: Alex Maitland Date: Thu, 14 Oct 2021 12:43:35 +1000 Subject: [PATCH] build.ps1 - Improve vswhere programfiles check --- build.ps1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build.ps1 b/build.ps1 index 7c4570ff69..bcd0275252 100644 --- a/build.ps1 +++ b/build.ps1 @@ -518,9 +518,13 @@ DownloadNuget NugetPackageRestore $VCXProjPackageConfigFiles -$ProgramFilesDir = (${env:ProgramFiles(x86)}, ${env:ProgramFiles} -ne $null)[0] +$VSWherePath = Join-Path ${env:ProgramFiles} 'Microsoft Visual Studio\Installer\vswhere.exe' + +if(-not (Test-Path $VSWherePath)) +{ + $VSWherePath = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe' +} -$VSWherePath = Join-Path $ProgramFilesDir 'Microsoft Visual Studio\Installer\vswhere.exe' #Check if we already have vswhere which is included in newer versions of VS2017/VS2019 if(-not (Test-Path $VSWherePath)) {