diff --git a/libs/ardour/vst3_module.cc b/libs/ardour/vst3_module.cc index e188966d8b..7fe7ca2aba 100644 --- a/libs/ardour/vst3_module.cc +++ b/libs/ardour/vst3_module.cc @@ -49,8 +49,7 @@ class VST3MacModule : public VST3PluginModule public: VST3MacModule (std::string const& module_path) { - std::string path = Glib::path_get_dirname (module_path); // MacOS - path = Glib::path_get_dirname (path); // Contents + std::string path = Glib::path_get_dirname (module_path); // Contents path = Glib::path_get_dirname (path); // theVST.vst3 CFURLRef url = CFURLCreateFromFileSystemRepresentation (0, (const UInt8*)path.c_str (), (CFIndex)path.length (), true); if (url) { diff --git a/libs/ardour/vst3_scan.cc b/libs/ardour/vst3_scan.cc index 9d7b7b0bf1..202c53764a 100644 --- a/libs/ardour/vst3_scan.cc +++ b/libs/ardour/vst3_scan.cc @@ -244,18 +244,23 @@ ARDOUR::module_path_vst3 (string const& path) module_path = Glib::build_filename (path, "Contents", vst3_bindir (), PBD::basename_nosuffix (path) + vst3_suffix ()); } - if (!Glib::file_test (module_path, Glib::FILE_TEST_IS_REGULAR)) { + #ifdef __APPLE__ - if (Glib::file_test (Glib::path_get_dirname (module_path), Glib::FILE_TEST_IS_DIR) && - Glib::file_test (Glib::build_filename (path, "Contents", "Info.plist"), Glib::FILE_TEST_IS_REGULAR)) { - /* Alternatively check for "Contents/MacOS" and an Info.plist file. - * VST3MacModule calls CFBundleCreate() which handles Info.plist files. - * (this is for plugins that use PACE, the MacOS folder usually - * contains a file + "Protect"). - */ - return module_path; - } + /* Check for "Contents/MacOS/" and "Context/Info.plist". + * VST3MacModule calls CFBundleCreate() which handles Info.plist files. + * (on macOS/X the binrary name may differ from the bundle name) + */ + string plist = Glib::build_filename (path, "Contents", "Info.plist"); + if (Glib::file_test (Glib::path_get_dirname (module_path), Glib::FILE_TEST_IS_DIR) && + Glib::file_test (Glib::build_filename (path, "Contents", "Info.plist"), Glib::FILE_TEST_IS_REGULAR)) { + return plist; + } else { + cerr << "VST3 not a valid bundle: '" << path << "'\n"; + return ""; + } #endif + + if (!Glib::file_test (module_path, Glib::FILE_TEST_IS_REGULAR)) { cerr << "VST3 not a valid bundle: '" << module_path << "'\n"; return ""; }