From: theadib Date: Wed, 12 Mar 2008 21:36:44 +0000 (+0000) Subject: tweaked patch from Ulf to make extension working X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=05eb039990d07b9577010bc9e8be0fae5a6aabc9;p=inkscape.git tweaked patch from Ulf to make extension working --- diff --git a/build.xml b/build.xml index 4f675358b..486a43d86 100644 --- a/build.xml +++ b/build.xml @@ -593,6 +593,7 @@ + diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 66383e5f9..381b02b08 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -152,7 +152,7 @@ resolveInterpreterExecutable(const Glib::ustring &interpNameArg) if (rt.getExeInfo(fullPath, path, exeName)) { Glib::ustring interpPath = path; interpPath.append("\\"); - interpPath.append(interpName); + interpPath.append(interpNameArg); interpPath.append("\\"); interpPath.append(interpName); interpPath.append(".exe"); diff --git a/src/main.cpp b/src/main.cpp index df62e8d0d..30bb0a09f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -413,6 +413,43 @@ struct poptOption options[] = { static bool needToRecodeParams = true; gchar* blankParam = ""; +#ifdef WIN32 +static int _win32_set_inkscape_env(char *argv0) +{ + CHAR szFullPath[_MAX_PATH]; + + CHAR szDrive[_MAX_DRIVE]; + CHAR szDir[_MAX_DIR]; + CHAR szFile[_MAX_FNAME]; + CHAR szExt[_MAX_EXT]; + + CHAR tmp[_MAX_EXT]; + + if (GetModuleFileName(NULL, szFullPath, sizeof(szFullPath)) == 0) { + strcpy(szFullPath, argv0); + } + + _splitpath(szFullPath, szDrive, szDir, szFile, szExt); + strcpy(szFullPath, szDrive); + strcat(szFullPath, szDir); + + strcpy(tmp, "PATH="); + strcat(tmp, szFullPath); + strcat(tmp, ";"); + strcat(tmp, szFullPath); + strcat(tmp, "python\\"); + strcat(tmp, ";%PATH%"); + _putenv(tmp); + + strcpy(tmp, "PYTHONPATH="); + strcat(tmp, szFullPath); + strcat(tmp, "python\\"); + _putenv(tmp); + + return 0; +} +#endif + int main(int argc, char **argv) { @@ -425,6 +462,7 @@ main(int argc, char **argv) #ifdef ENABLE_NLS #ifdef WIN32 + _win32_set_inkscape_env(argv[0]) RegistryTool rt; rt.setPathInfo(); gchar *pathBuf = g_strconcat(g_path_get_dirname(argv[0]), "\\", PACKAGE_LOCALE_DIR, NULL);