]> git.street.me.uk Git - andy/viking.git/commitdiff
Enable Windows installation to search for and use deployed extension configuration...
authorRob Norris <rw_norris@hotmail.com>
Thu, 1 May 2014 23:51:17 +0000 (00:51 +0100)
committerRob Norris <rw_norris@hotmail.com>
Thu, 1 May 2014 23:51:17 +0000 (00:51 +0100)
src/dir.c
win32/installer.bat

index 161ed408bd717a0d2b827f10a5d3300032e999bd..08d96334c32d8859688f835272c51756222e6ccc 100644 (file)
--- a/src/dir.c
+++ b/src/dir.c
@@ -105,7 +105,13 @@ a_get_viking_data_home()
 gchar **
 a_get_viking_data_path()
 {
+#ifdef WINDOWS
+  // Try to use from the install directory - normally the working directory of Viking is where ever it's install location is
+  const gchar *xdg_data_dirs = "./data";
+  //const gchar *xdg_data_dirs = g_strdup ( "%s/%s/data", g_getenv("ProgramFiles"), PACKAGE );
+#else
   const gchar *xdg_data_dirs = g_getenv("XDG_DATA_DIRS");
+#endif
   if (xdg_data_dirs == NULL)
   {
     /* Default value specified in 
@@ -114,6 +120,7 @@ a_get_viking_data_path()
     xdg_data_dirs = "/usr/local/share/:/usr/share/";
   }
   gchar **data_path = g_strsplit(xdg_data_dirs, ":", 0);
+#ifndef WINDOWS
   /* Append the viking dir */
   gchar **path;
   for (path = data_path ; *path != NULL ; path++)
@@ -122,5 +129,6 @@ a_get_viking_data_path()
     *path = g_build_filename(dir, PACKAGE, NULL);
     g_free(dir);
   }
+#endif
   return data_path;
 }
index b05c691cd938d57ea3b70585575922c511e0f2aa..1810927bec0a37009859009a9f391feeb8f7efd4 100644 (file)
@@ -34,6 +34,9 @@ echo Copying Viking
 :: ATM this relies on being generated by an external system\r
 %MYCOPY% ..\help\C\viking.pdf %DESTINATION%\r
 \r
+echo Copying Extension Configuration Data\r
+mkdir %DESTINATION%\data\r
+%MYCOPY% ..\data\*.xml %DESTINATION%\data\r
 \r
 echo Copying Libraries\r
 set MINGW=C:\MinGW\r