From ecfc9efaf66d054fda239f48ef984190a89e6bae Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 4 Feb 2018 02:00:23 +0100 Subject: Add Inkscape root dir to DLL search path This avoids dynamically linked python modules searching for their libraries somewhere else on the PATH. The default search order is module directory -> system directories -> current working directory and only then the PATH is searched. The call to SetDllDirectory() adds the Inkscape root directory directly in second place instead. Details: https://github.com/numpy/numpy/wiki/windows-dll-notes Fixed bug: - https://bugs.launchpad.net/inkscape/+bug/1746092 --- src/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 94e63ec1c..8a58247c0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -566,6 +566,11 @@ gchar * blankParam = g_strdup(""); */ static void _win32_set_inkscape_env(gchar const *exe) { + // add inkscape directory to DLL search path so dynamically linked extension modules find their libraries + wchar_t *exe_w = (wchar_t *)g_utf8_to_utf16(exe, -1, NULL, NULL, NULL); + SetDllDirectoryW(exe_w); + g_free(exe_w); + gchar const *path = g_getenv("PATH"); gchar const *pythonpath = g_getenv("PYTHONPATH"); -- cgit v1.2.3