diff --git a/CMakeLists.txt b/CMakeLists.txt index 293d2d24f..02b03fa35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,6 @@ option(IMHEX_REPLACE_DWARF_WITH_PDB "Remove DWARF information from binaries option(IMHEX_STRICT_WARNINGS "Enable most available warnings and treat them as errors" ON ) option(IMHEX_DISABLE_STACKTRACE "Disables support for printing stack traces" OFF) ## Plugins -option(IMHEX_PLUGINS_IN_SHARE "Put the plugins in share/imhex/plugins instead of lib[..]/imhex/plugins (Linux only)" OFF) option(IMHEX_STATIC_LINK_PLUGINS "Statically link all plugins into the main executable" OFF) option(IMHEX_ENABLE_PLUGIN_TESTS "Enable building plugin tests" ON ) option(IMHEX_INCLUDE_PLUGINS "Semicolon-separated list of plugins to include in the build (empty = build all)" "" ) diff --git a/cmake/build_helpers.cmake b/cmake/build_helpers.cmake index 1455a222d..e534c8f8e 100644 --- a/cmake/build_helpers.cmake +++ b/cmake/build_helpers.cmake @@ -175,15 +175,11 @@ macro(detectOS) endif() include(GNUInstallDirs) - if(IMHEX_PLUGINS_IN_SHARE) - set(PLUGINS_INSTALL_LOCATION "share/imhex/plugins") - else() - set(PLUGINS_INSTALL_LOCATION "${CMAKE_INSTALL_LIBDIR}/imhex/plugins") + set(PLUGINS_INSTALL_LOCATION "${CMAKE_INSTALL_LIBDIR}/imhex/plugins") - # Add System plugin location for plugins to be loaded from - # IMPORTANT: This does not work for Sandboxed or portable builds such as the Flatpak or AppImage release - add_compile_definitions(SYSTEM_PLUGINS_LOCATION="${CMAKE_INSTALL_FULL_LIBDIR}/imhex") - endif() + # Add System plugin location for plugins to be loaded from + # IMPORTANT: This does not work for Sandboxed or portable builds such as the Flatpak or AppImage release + add_compile_definitions(SYSTEM_PLUGINS_LOCATION="${CMAKE_INSTALL_FULL_LIBDIR}/imhex") else () message(FATAL_ERROR "Unknown / unsupported system!") diff --git a/dist/AppImage/Dockerfile b/dist/AppImage/Dockerfile index 6a84ca21f..243f4100a 100644 --- a/dist/AppImage/Dockerfile +++ b/dist/AppImage/Dockerfile @@ -42,17 +42,18 @@ RUN < 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 paths = getDataPaths(true); // Add the system plugin directory to the path if one was provided at compile time