diff -u --recursive gnumeric-1.9.0-vanilla/src/gutils.c gnumeric-1.9.0/src/gutils.c
--- gnumeric-1.9.0-vanilla/src/gutils.c	2008-05-22 20:19:25.000000000 -0400
+++ gnumeric-1.9.0/src/gutils.c	2008-05-22 21:00:31.000000000 -0400
@@ -39,20 +39,16 @@
 static char *gnumeric_usr_dir;
 
 void
-gutils_init (void)
+gutils_init (const char *param_data_dir, const char *param_lib_dir)
 {
 	char const *home_dir;
 #ifdef G_OS_WIN32
-	gchar *dir = g_win32_get_package_installation_directory (NULL, NULL);
-	gnumeric_lib_dir = g_build_filename (dir, "lib",
-					     "gnumeric", GNM_VERSION_FULL,
-					     NULL);
-	gnumeric_data_dir = g_build_filename (dir, "share",
-					      "gnumeric", GNM_VERSION_FULL,
-					      NULL);
-	gnumeric_icon_dir = g_build_filename (dir, "share", "pixmaps",
-					      "gnumeric", NULL);
-	gnumeric_locale_dir = g_build_filename (dir, "share", "locale", NULL);
+        gchar *dir = g_win32_get_package_installation_directory (NULL, NULL);
+	gnumeric_lib_dir = param_lib_dir ? g_strdup(param_lib_dir) : g_build_filename(g_win32_get_package_installation_directory (NULL, NULL), "share", "gnumeric", GNM_VERSION_FULL, NULL);
+        gnumeirc_data_dir = param_data_dir ? g_strdup(param_data_dir) : g_build_filename(g_win32_get_package_installation_directory (NULL, NULL), "lib", "gnumeric", GNM_VERSION_FULL, NULL);
+        gnumeric_icon_dir = g_build_filename (dir, "share", "pixmaps",
+                                              "gnumeric", NULL);
+        gnumeric_locale_dir = g_build_filename (dir, "share", "locale", NULL);
 	g_free (dir);
 #else
 	const char *argv0 = g_get_prgname ();
@@ -74,8 +70,8 @@
 	}
 
 	if (!gnumeric_lib_dir)
-		gnumeric_lib_dir = g_strdup (GNUMERIC_LIBDIR);
-	gnumeric_data_dir = g_strdup (GNUMERIC_DATADIR);
+		gnumeric_lib_dir = param_lib_dir ? g_strdup(param_lib_dir) : g_strdup (GNUMERIC_LIBDIR);
+	gnumeric_data_dir = param_data_dir ? g_strdup(param_data_dir) : g_strdup (GNUMERIC_DATADIR);
 	gnumeric_icon_dir = g_strdup (GNUMERIC_ICONDIR);
 	gnumeric_locale_dir = g_strdup (GNUMERIC_LOCALEDIR);
 #endif
diff -u --recursive gnumeric-1.9.0-vanilla/src/gutils.h gnumeric-1.9.0/src/gutils.h
--- gnumeric-1.9.0-vanilla/src/gutils.h	2008-05-22 20:19:25.000000000 -0400
+++ gnumeric-1.9.0/src/gutils.h	2008-05-22 20:19:58.000000000 -0400
@@ -7,7 +7,7 @@
 
 G_BEGIN_DECLS
 
-void gutils_init (void);
+void gutils_init (const char *param_data_dir, const char *param_lib_dir);
 void gutils_shutdown (void);
 
 /* System and user paths */
diff -u --recursive gnumeric-1.9.0-vanilla/src/libgnumeric.c gnumeric-1.9.0/src/libgnumeric.c
--- gnumeric-1.9.0-vanilla/src/libgnumeric.c	2008-05-22 20:19:25.000000000 -0400
+++ gnumeric-1.9.0/src/libgnumeric.c	2008-05-22 20:23:24.000000000 -0400
@@ -212,17 +212,6 @@
 	/* Make stdout line buffered - we only use it for debug info */
 	setvbuf (stdout, NULL, _IOLBF, 0);
 
-	gutils_init ();
-
-	bindtextdomain (GETTEXT_PACKAGE, gnm_locale_dir ());
-	bindtextdomain (GETTEXT_PACKAGE "-functions", gnm_locale_dir ());
-	textdomain (GETTEXT_PACKAGE);
-
-	/* Force all of the locale segments to update from the environment.
-	 * Unless we do this they will default to C
-	 */
-	setlocale (LC_ALL, "");
-
 	return argv;
 }
 
@@ -249,6 +238,17 @@
 void
 gnm_init (gboolean fast)
 {
+	gutils_init (param_data_dir, param_lib_dir);
+
+	bindtextdomain (GETTEXT_PACKAGE, gnm_locale_dir ());
+	bindtextdomain (GETTEXT_PACKAGE "-functions", gnm_locale_dir ());
+	textdomain (GETTEXT_PACKAGE);
+
+	/* Force all of the locale segments to update from the environment.
+	 * Unless we do this they will default to C
+	 */
+	setlocale (LC_ALL, "");
+
 #if defined (GNM_WITH_GNOME) || defined (GNM_USE_HILDON)
 	gnome_vfs_init ();
 #endif
