From ae745628931c5b6ec722b22918b6e4ffb95308fd Mon Sep 17 00:00:00 2001 From: Ryan Kurtz Date: Mon, 17 Jul 2023 11:59:01 -0400 Subject: [PATCH] GP-3639: Creating -PvswherePath Gradle property to manually specify path to vswhere.exe --- GPL/vsconfig.gradle | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/GPL/vsconfig.gradle b/GPL/vsconfig.gradle index 797c89e390..a010f079dc 100644 --- a/GPL/vsconfig.gradle +++ b/GPL/vsconfig.gradle @@ -27,9 +27,11 @@ def configureVisualStudio() { // Use vswhere.exe to search for latest Visual Studio installation println "Searching for latest Visual Studio and required components..." - def vswherePath = "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe" + def programFiles = System.getenv()["ProgramFiles(x86)"] ?: "C:\\Program Files (x86)" + def vswherePath = findProperty("vswherePath") ?: "${programFiles}\\Microsoft Visual Studio\\Installer\\vswhere.exe" if (!file(vswherePath).exists()) { - println " -> Visual Studio vswhere.exe not found!" + println " -> Visual Studio vswhere.exe not found at \"${vswherePath}\"" + println " -> To manually specify the location of vswhere.exe, add \"-PvswherePath=\" to the Gradle command line arguments" return } def vswhereProcess = "${vswherePath} -products * -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -format json -utf8".execute()