ghidra-mcp-setup.ps1 installs in the wrong directory
envgap__bethington__ghidra-mcp-19
01 / FAILURE SIGNATURE
As reported upstream
No identifying execution failure has been captured.
Not a benchmark task.
- In a clean container the reported failure did not reproduce, or the known fix did not make the project run.
02 / ENVIRONMENT RECIPE
- Base commit
f3f8a6295e4c2cfa5af7ea57fbd67e9d48ca42ad- Manifest
pom.xml- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
bethington/ghidra-mcp #19 · read the original issue
Hello, just a minor issue.
I have both Ghidra 12.0 and 12.0.2 installed.
In this case, ghidra-mcp-setup.ps1 installs the JAR file in `$env:USERPROFILE\AppData\Roaming\ghidra\ghidra_12.0_PUBLIC\` instead of `$env:USERPROFILE\AppData\Roaming\ghidra\ghidra_12.0.2_PUBLIC\`.
This is due to the following lines (880-888):
```
if (Test-Path $ghidraUserBase) {
# Find the most recent ghidra version directory
$ghidraVersionDirs = Get-ChildItem -Path $ghidraUserBase -Directory -Filter "ghidra_*" |
Sort-Object Name -Descending
if ($ghidraVersionDirs) {
$ghidraVersionDir = $ghidraVersionDirs[0].Name
Write-LogInfo "Detected Ghidra user config version: $ghidraVersionDir"
}
}
```
And `ghidra_12.0_PUBLIC` comes before `ghidra_12.0.2_PUBLIC`.
IMHO I would just keep the logic marked as fallback (lines 890-898). You already know the Ghidra version, so just choose the corresponding user config folder, there's no need to detect what other folders are present. I would rather make the script fail if the corresponding user config folder is not found, which may happen if you've just installed a new Ghidra version and you haven't run it yet.
04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]