summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2018-02-04 01:00:23 +0000
committerEduard Braun <eduard.braun2@gmx.de>2018-02-21 23:30:43 +0000
commitecfc9efaf66d054fda239f48ef984190a89e6bae (patch)
treebfc3610712c6b1ec7888daef770c3bb06ab38ab2
parentCI/AppVeyor: add new dependency (diff)
downloadinkscape-ecfc9efaf66d054fda239f48ef984190a89e6bae.tar.gz
inkscape-ecfc9efaf66d054fda239f48ef984190a89e6bae.zip
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
-rw-r--r--src/main.cpp5
1 files changed, 5 insertions, 0 deletions
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");