diff options
Diffstat (limited to 'libs/ardour/filesystem_paths.cc')
-rw-r--r-- | libs/ardour/filesystem_paths.cc | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/libs/ardour/filesystem_paths.cc b/libs/ardour/filesystem_paths.cc index fe1afd85d8..7e9b4e1857 100644 --- a/libs/ardour/filesystem_paths.cc +++ b/libs/ardour/filesystem_paths.cc @@ -200,7 +200,7 @@ std::string ardour_dll_directory () { #ifdef PLATFORM_WINDOWS - std::string dll_dir_path(g_win32_get_package_installation_directory_of_module(NULL)); + std::string dll_dir_path(windows_package_directory_path()); dll_dir_path = Glib::build_filename (dll_dir_path, "lib"); return Glib::build_filename (dll_dir_path, LIBARDOUR); #else @@ -217,10 +217,27 @@ ardour_dll_directory () Searchpath windows_search_path () { - std::string dll_dir_path(g_win32_get_package_installation_directory_of_module(NULL)); + std::string dll_dir_path(windows_package_directory_path()); dll_dir_path = Glib::build_filename (dll_dir_path, "share"); return Glib::build_filename (dll_dir_path, LIBARDOUR); } + +std::string +windows_package_directory_path () +{ + char* package_dir = + g_win32_get_package_installation_directory_of_module (NULL); + + if (package_dir == NULL) { + fatal << string_compose (_("Cannot determine %1 package directory"), + PROGRAM_NAME) << endmsg; + // not reached + } + + std::string package_dir_path(package_dir); + g_free(package_dir); + return package_dir_path; +} #endif Searchpath |