Fix missing comment.
[ardour.git] / gtk2_ardour / bundle_env_mingw.cc
index c4e14c20814e0a625bcd1b7eb3465eefccdd99a3..0d977cabbaa2d07efd7d2a4dfee13c27dd06d9a5 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include <stdlib.h>
+#include <string>
 #include "bundle_env.h"
 #include "i18n.h"
 
@@ -84,7 +85,7 @@ get_install_path ()
 
 
 void
-fixup_bundle_environment (int, char* [], const char** localedir)
+fixup_bundle_environment (int, char* [], string & localedir)
 {
        EnvironmentalProtectionAgency::set_global_epa (new EnvironmentalProtectionAgency (true));
        /* what to do ? */
@@ -95,8 +96,17 @@ fixup_bundle_environment (int, char* [], const char** localedir)
        // Unset GTK_RC_FILES so that only ardour specific files are loaded
        Glib::unsetenv ("GTK_RC_FILES");
 
-
        std::string path;
+
+       if (ARDOUR::translations_are_enabled ()) {
+               path = windows_search_path().to_string();
+               path += "\\locale";
+               Glib::setenv ("GTK_LOCALEDIR", path, true);
+
+               // and return the same path to our caller
+               localedir = path;
+       }
+
        const char *cstr;
        cstr = getenv ("VAMP_PATH");
        if (cstr) {
@@ -105,12 +115,23 @@ fixup_bundle_environment (int, char* [], const char** localedir)
        } else {
                path = "";
        }
-       path += Glib::build_filename(get_install_path(), "lib", "ardour3", "vamp");
+       path += Glib::build_filename(ardour_dll_directory(), "vamp");
        path += G_SEARCHPATH_SEPARATOR;
        path += "%ProgramFiles%\\Vamp Plugins"; // default vamp path
        path += G_SEARCHPATH_SEPARATOR;
        path += "%COMMONPROGRAMFILES%\\Vamp Plugins";
        Glib::setenv ("VAMP_PATH", path, true);
+
+       Glib::setenv ("SUIL_MODULE_DIR", Glib::build_filename(ardour_dll_directory(), "suil"), true);
+
+       /* XXX this should really be PRODUCT_EXE see tools/x-win/package.sh
+        * ardour on windows does not have a startup wrapper script.
+        *
+        * then again, there's probably nobody using NSM on windows.
+        * because neither nsmd nor the GUI is currently available for windows.
+        * furthermore it'll be even less common for derived products.
+        */
+       Glib::setenv ("ARDOUR_SELF", Glib::build_filename(ardour_dll_directory(), "ardour.exe"), true);
 }
 
 static __cdecl void