mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
build: remove IMHEX_PLUGINS_IN_SHARE option + only allow AppImage to load plugins from inside itself
Rationale: The `IMHEX_PLUGINS_IN_SHARE` is a hack to prevent the appimage from loading plugin from system imhex installation, like /usr/lib/imhex/ In reality, I do not think people compile plugins specifically for the AppImage (plugins must be compiled for the specific imhex & compiler version the imhex binary is used), and this lets us remove the hack
This commit is contained in:
@@ -97,6 +97,13 @@ namespace hex::paths {
|
||||
}
|
||||
|
||||
static std::vector<std::fs::path> getPluginPaths() {
|
||||
// If running from an AppImage, only allow loaded plugins from inside it
|
||||
#if defined(OS_LINUX)
|
||||
if(const char* appdir = std::getenv("APPDIR")) { // check for AppImage environment
|
||||
return {std::string(appdir) + "/usr/lib/imhex"};
|
||||
}
|
||||
#endif
|
||||
|
||||
std::vector<std::fs::path> paths = getDataPaths(true);
|
||||
|
||||
// Add the system plugin directory to the path if one was provided at compile time
|
||||
|
||||
Reference in New Issue
Block a user