diff options
| author | Adib Taraben <theadib@gmail.com> | 2008-03-12 21:36:44 +0000 |
|---|---|---|
| committer | theadib <theadib@users.sourceforge.net> | 2008-03-12 21:36:44 +0000 |
| commit | 38c0c4d6ebb86648119df25d418d910878faaa32 (patch) | |
| tree | 3e956b0896561bc413aeb4b4839e30bb12e5d50c /src/main.cpp | |
| parent | Making/copying the /share/java dir is ok even if you don't use it. Now there... (diff) | |
| download | inkscape-38c0c4d6ebb86648119df25d418d910878faaa32.tar.gz inkscape-38c0c4d6ebb86648119df25d418d910878faaa32.zip | |
tweaked patch from Ulf to make extension working
(bzr r5073)
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
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); |
