]> spindle.queued.net Git - midori/commitdiff
Look for extensions relative to program folder on win32
authorPeter de Ridder <peter@xfce.org>
Mon, 15 Feb 2010 23:42:39 +0000 (00:42 +0100)
committerChristian Dywan <christian@twotoasts.de>
Mon, 15 Feb 2010 23:59:42 +0000 (00:59 +0100)
midori/main.c

index 9c6848d3df8ccaeff518afe3c6e22186f69b31fe..8c01f623193ba63eedd54e6fc70dea6c6ad7a946 100644 (file)
@@ -1076,7 +1076,22 @@ midori_load_extensions (gpointer data)
         GDir* extension_dir;
 
         if (!(extension_path = g_strdup (g_getenv ("MIDORI_EXTENSION_PATH"))))
+        {
+            #ifdef G_OS_WIN32
+            {
+                gchar *path = g_win32_get_package_installation_directory_of_module (NULL);
+                extension_path = g_build_filename (path, "lib", PACKAGE_NAME, NULL);
+                g_free (path);
+                if (g_access (extension_path, F_OK) != 0)
+                {
+                    g_free (extension_path);
+                    extension_path = g_build_filename (LIBDIR, PACKAGE_NAME, NULL);
+                }
+            }
+            #else
             extension_path = g_build_filename (LIBDIR, PACKAGE_NAME, NULL);
+            #endif
+        }
         extension_dir = g_dir_open (extension_path, 0, NULL);
         if (extension_dir != NULL)
         {