From: theadib Date: Sun, 16 Mar 2008 21:33:03 +0000 (+0000) Subject: prepend correctly the PATH and append an existist PYTHONPATH if existing X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=16ed349cd6f193bb5eef5678f6bdb87e3c92b676;p=inkscape.git prepend correctly the PATH and append an existist PYTHONPATH if existing --- diff --git a/src/main.cpp b/src/main.cpp index 7530b854b..d86b60540 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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; }