Code

prepend correctly the PATH and append an existist PYTHONPATH if existing
authortheadib <theadib@users.sourceforge.net>
Sun, 16 Mar 2008 21:33:03 +0000 (21:33 +0000)
committertheadib <theadib@users.sourceforge.net>
Sun, 16 Mar 2008 21:33:03 +0000 (21:33 +0000)
src/main.cpp

index 7530b854b01b8e064d3e3d3b15551ef9c68e7caf..d86b60540930441ad0c97fa36a5e26aa80e64262 100644 (file)
@@ -433,18 +433,33 @@ static int _win32_set_inkscape_env(char *argv0)
     strcpy(szFullPath, szDrive);
     strcat(szFullPath, szDir);
 
-    strcpy(tmp, "PATH=");
+    char *oldenv = getenv("PATH");
+       strcpy(tmp, "PATH=");
     strcat(tmp, szFullPath);
     strcat(tmp, ";");
     strcat(tmp, szFullPath);
-    strcat(tmp, "python\\");
-    strcat(tmp, ";%PATH%");
-    _putenv(tmp);
-
+    strcat(tmp, "python;");
+    strcat(tmp, szFullPath);
+    strcat(tmp, "perl;");
+    if(oldenv != NULL) {
+               strcat(tmp, ";");
+               strcat(tmp, oldenv);
+       }
+       _putenv(tmp);
+
+    oldenv = getenv("PYTHONPATH");
     strcpy(tmp, "PYTHONPATH=");
     strcat(tmp, szFullPath);
-    strcat(tmp, "python\\");
-    _putenv(tmp);
+    strcat(tmp, "python;");
+    strcat(tmp, szFullPath);
+    strcat(tmp, "python\\Lib;");
+    strcat(tmp, szFullPath);
+    strcat(tmp, "python\\DLLs");
+    if(oldenv != NULL) {
+               strcat(tmp, ";");
+               strcat(tmp, oldenv);
+       }
+       _putenv(tmp);
 
     return 0;
 }