mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-31 15:56:23 +08:00
GP-2928: Better error handling and documentation for unsupported
versions of visual studio
This commit is contained in:
@@ -71,7 +71,7 @@ task CheckToolChain {
|
||||
if (isCurrentWindows()) {
|
||||
// ensure that required MS Visual Studio is installed
|
||||
if (!VISUAL_STUDIO_INSTALL_DIR) {
|
||||
throw new GradleException("Visual Studio not found!");
|
||||
throw new GradleException("Supported Windows native toolchain not found!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+14
-1
@@ -32,7 +32,20 @@ def configureVisualStudio() {
|
||||
println " -> Visual Studio vswhere.exe not found!"
|
||||
return
|
||||
}
|
||||
def vswhereOutput = "${vswherePath} -products * -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -format json".execute().text.trim()
|
||||
def vswhereProcess = "${vswherePath} -products * -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -format json -utf8".execute()
|
||||
def vswhereOutput = vswhereProcess.text.trim()
|
||||
def vswhereExit = vswhereProcess.exitValue()
|
||||
if (vswhereExit != 0) {
|
||||
if (vswhereExit == 87) { // ERROR_INVALID_PARAMATER
|
||||
println " -> Visual Studio vswhere.exe was passed an unsupported argument!"
|
||||
}
|
||||
else {
|
||||
println " -> Visual Studio vswhere.exe returned an error code (${vswhereExit})!"
|
||||
}
|
||||
println " -> Please confirm ${vswherePath} is version 2.5 or later."
|
||||
println " -> Please check README.md or InstallationGuide.html to verify you are using a supported version of Visual Studio."
|
||||
return
|
||||
}
|
||||
def vswhereJson = new groovy.json.JsonSlurper().parseText(vswhereOutput);
|
||||
if (vswhereJson.isEmpty()) {
|
||||
println " -> Visual Studio not found!"
|
||||
|
||||
Reference in New Issue
Block a user