Is your feature request related to a problem? Please describe.
When distributing Ghidra internally, we install it in a non-writable, per-machine installation dir: /opt/ghidra. Users that want to install/develop extensions, need to make their /opt/ghidra/Ghidra/Extensions directory writable.
This is not ideal, as we have packaged Ghidra into a Debian package and want to distribute it that way.
Describe the solution you'd like
Similar to what IDA Pro already supports: An additional search path in the user's local home directory to load Extensions from.
Suggested paths
%USERPROFILE%\\Local Settings\\Application Data\Ghidra\Extensions (note that this is non-roaming to avoid cluttering the user profile that travels with the user)$HOME/Library/Application Supprt/Ghidra/Extensions$HOME/.ghidra/ExtensionsThis would also enable to package Ghidra extensions as Debian packages and install alongside.
Describe alternatives you've considered
A bind-mount that overlays <GhidraInstallDir>/Ghidra/Extensions with one of the the paths above.
Additional context
If there is interest, I can have a stab at implementing this myself.
For a quick and possibly unsatisfying fix, you could replace the /opt/ghidra/Ghidra/Extensions directory with a link to something in the user's home directory when you install Ghidra on their system. I just tried that and it seemed to work. EDIT I just saw that you are doing this already, nevermind!
A relatively recent overall design goal of Ghidra is to never write anything into the installation directory for exactly the reason you describe, so this is something we should address at some point. Note that we also recompile processor sleigh files to the installation directory, so if your users need to do that...they might run into the same problem.
You are welcome to implement a solution to this yourself, but just know that we might go back and forth a lot on it...I'm not sure how much time you have to devote to it. There will probably need to be GUI elements to it too.
You are welcome to implement a solution to this yourself, but just know that we might go back and forth a lot on it...I'm not sure how much time you have to devote to it. There will probably need to be GUI elements to it too.
Sure, the back and forth is why I started the issue first and not just went ahead :) The way I see it, the required changes are not too invasive and I'd go for a minimal approach where the only additional UI work would be a visual indicator or sorts in the list of installed extensions.
For the sleigh recompilation, I need to think about this a bit more, as I haven't used that yet.
I'll try to come up with something soon-ish.
Sounds good! We'll want to put the new Extensions directory in Application.getUserSettingsDirectory() which will take care of the versioning, and we'll also need to retain the ability to find extensions in Ghidra/Extensions. I think the GUI checkboxes can just manage the extensions in the user directory. Perhaps any manually unzipped/installed Extensions in Ghidra/Extensions can visible in the table but not checkable. These could represent preinstalled extensions that an admin wanted to roll out to all users.
I'm really interested in this. Made a fork already and I will try to implement it but I can't say for sure :D
Yeah, I didn't really have the time to work on this. Go for it! :)
Hopefully no one worked on this. I just submitted a PR for it.
Most helpful comment
Hopefully no one worked on this. I just submitted a PR for it.