diff --git a/cmake/modules/PostprocessBundle.cmake b/cmake/modules/PostprocessBundle.cmake index 743a4b6b4..917e0e914 100644 --- a/cmake/modules/PostprocessBundle.cmake +++ b/cmake/modules/PostprocessBundle.cmake @@ -57,3 +57,7 @@ if (CODE_SIGN_CERTIFICATE_ID) execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${BUNDLE_PATH}") execute_process(COMMAND ${CMAKE_COMMAND} -E rename "${BUNDLE_PATH}.temp" "${BUNDLE_PATH}") endif() + +# Add a necessary rpath to the imhex binary +get_bundle_main_executable("${BUNDLE_PATH}" IMHEX_EXECUTABLE) +execute_process(COMMAND ${CMAKE_INSTALL_NAME_TOOL} -add_rpath @executable_path/../Frameworks/ "${IMHEX_EXECUTABLE}") diff --git a/plugins/libimhex/source/helpers/utils_mac.mm b/plugins/libimhex/source/helpers/utils_mac.mm index 073e2b54b..4ce16147c 100644 --- a/plugins/libimhex/source/helpers/utils_mac.mm +++ b/plugins/libimhex/source/helpers/utils_mac.mm @@ -19,29 +19,29 @@ NSURL * result = nil; switch (path) { case ImHexPath::Patterns: - result = [appSupportDir URLByAppendingPathComponent:@"/imhex/patterns"]; + result = [appSupportDir URLByAppendingPathComponent:@"imhex/patterns"]; break; case ImHexPath::PatternsInclude: - result = [appSupportDir URLByAppendingPathComponent:@"/imhex/patterns"]; + result = [appSupportDir URLByAppendingPathComponent:@"imhex/patterns"]; break; case ImHexPath::Magic: - result = [appSupportDir URLByAppendingPathComponent:@"/imhex/magic"]; + result = [appSupportDir URLByAppendingPathComponent:@"imhex/magic"]; break; case ImHexPath::Python: - result = [appSupportDir URLByAppendingPathComponent:@"/imhex"]; + result = [appSupportDir URLByAppendingPathComponent:@"imhex"]; break; case ImHexPath::Plugins: - result = [appSupportDir URLByAppendingPathComponent:@"/imhex/plugins"]; + result = [appSupportDir URLByAppendingPathComponent:@"imhex/plugins"]; break; case ImHexPath::Yara: - result = [appSupportDir URLByAppendingPathComponent:@"/imhex/yara"]; + result = [appSupportDir URLByAppendingPathComponent:@"imhex/yara"]; break; case ImHexPath::Config: - result = [appSupportDir URLByAppendingPathComponent:@"/imhex/config"]; + result = [appSupportDir URLByAppendingPathComponent:@"imhex/config"]; break; case ImHexPath::Resources: - result = [appSupportDir URLByAppendingPathComponent:@"/imhex/resources"]; + result = [appSupportDir URLByAppendingPathComponent:@"imhex/resources"]; break; } diff --git a/source/helpers/plugin_manager.cpp b/source/helpers/plugin_manager.cpp index eec8c4596..37b29337d 100644 --- a/source/helpers/plugin_manager.cpp +++ b/source/helpers/plugin_manager.cpp @@ -15,8 +15,10 @@ namespace hex { Plugin::Plugin(std::string_view path) { this->m_handle = dlopen(path.data(), RTLD_LAZY); - if (this->m_handle == nullptr) + if (this->m_handle == nullptr) { + hex::log::error("dlopen failed: {}", dlerror()); return; + } auto pluginName = fs::path(path).stem().string(); diff --git a/source/window.cpp b/source/window.cpp index 1c5bfcf0d..b137c62c2 100644 --- a/source/window.cpp +++ b/source/window.cpp @@ -100,8 +100,12 @@ namespace hex { { auto language = ContentRegistry::Settings::getSetting("hex.builtin.setting.interface", "hex.builtin.setting.interface.language"); - if (language.is_string()) + if (language.is_string()) { LangEntry::loadLanguage(static_cast(language)); + } else { + // If no language is specified, fall back to English. + LangEntry::loadLanguage("en-US"); + } } { @@ -787,4 +791,4 @@ namespace hex { ImGui::DestroyContext(); } -} \ No newline at end of file +}