From 16ed349cd6f193bb5eef5678f6bdb87e3c92b676 Mon Sep 17 00:00:00 2001 From: theadib Date: Sun, 16 Mar 2008 21:33:03 +0000 Subject: [PATCH] prepend correctly the PATH and append an existist PYTHONPATH if existing --- src/main.cpp | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) 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; } -- 2.30.2