Code

Cleaned and applied portable app patch. Fixes bug #382394.
[inkscape.git] / src / inkscape.cpp
index f1e2c1684c47554eb38a29d1f53efdb8adc1463f..60ab895ede7789bf05f082b957aaf1f017375f40 100644 (file)
@@ -1381,7 +1381,15 @@ gchar *
 profile_path(const char *filename)
 {
     static const gchar *prefdir = NULL;
+
+
     if (!prefdir) {
+        // First check for a custom environment variable for a "portable app"
+        gchar const *val = g_getenv("INKSCAPE_PORTABLE_PROFILE_DIR");
+        if (val) {
+            prefdir = g_strdup(val);
+        }
+
 #ifdef HAS_SHGetSpecialFolderLocation
         // prefer c:\Documents and Settings\UserName\Application Data\ to
         // c:\Documents and Settings\userName\;