Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-3639: Creating -PvswherePath Gradle property to manually specify path to vswhere.exe

Ryan Kurtzae745628931c
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=<vswhere path>\" to the Gradle command line arguments"
return
}
def vswhereProcess = "${vswherePath} -products * -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -format json -utf8".execute()