mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GP-0: Fix DummyProc.which
This commit is contained in:
@@ -35,22 +35,29 @@ public class DummyProc implements AutoCloseable {
|
|||||||
return Application.getOSFile(cmd).getAbsolutePath();
|
return Application.getOSFile(cmd).getAbsolutePath();
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
|
// probably Application is not initialized
|
||||||
// just try next strategy
|
// just try next strategy
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try the build/exe/<cmd>/ and build/exe/<cmd>/<platform>/ directory
|
// Try the build/exe/<cmd>/ and build/exe/<cmd>/<platform>/ directory
|
||||||
for (ResourceFile modRoot : Application.getModuleRootDirectories()) {
|
try {
|
||||||
ResourceFile exe = new ResourceFile(modRoot, "build/exe/" + cmd + "/" + cmd);
|
for (ResourceFile modRoot : Application.getModuleRootDirectories()) {
|
||||||
if (exe.exists() && exe.getFile(false).canExecute()) {
|
ResourceFile exe = new ResourceFile(modRoot, "build/exe/" + cmd + "/" + cmd);
|
||||||
return exe.getAbsolutePath();
|
if (exe.exists() && exe.getFile(false).canExecute()) {
|
||||||
}
|
return exe.getAbsolutePath();
|
||||||
ResourceFile platformExe = new ResourceFile(modRoot,
|
}
|
||||||
"build/exe/" + cmd + "/" + Platform.CURRENT_PLATFORM.getDirectoryName() + "/" +
|
ResourceFile platformExe = new ResourceFile(modRoot,
|
||||||
cmd);
|
"build/exe/" + cmd + "/" + Platform.CURRENT_PLATFORM.getDirectoryName() + "/" +
|
||||||
if (platformExe.exists() && platformExe.getFile(false).canExecute()) {
|
cmd);
|
||||||
return platformExe.getAbsolutePath();
|
if (platformExe.exists() && platformExe.getFile(false).canExecute()) {
|
||||||
|
return platformExe.getAbsolutePath();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
// probably Application is not initialized
|
||||||
|
// just try next strategy
|
||||||
|
}
|
||||||
|
|
||||||
// Try the current directory
|
// Try the current directory
|
||||||
if (new File(cmd).canExecute()) {
|
if (new File(cmd).canExecute()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user