summaryrefslogtreecommitdiffstats
path: root/src/inkscape-main.cpp
diff options
context:
space:
mode:
authorPatrick Storz <eduard.braun2@gmx.de>2019-03-30 13:42:22 +0000
committerPatrick Storz <eduard.braun2@gmx.de>2019-03-30 16:14:23 +0000
commit96117fe989d09286de03d7cc6110d6016ebab3e1 (patch)
treec4eeee6f9ee08e70504d258af402bf3ce11b4db1 /src/inkscape-main.cpp
parentscript.cpp: more cleanup (diff)
downloadinkscape-96117fe989d09286de03d7cc6110d6016ebab3e1.tar.gz
inkscape-96117fe989d09286de03d7cc6110d6016ebab3e1.zip
Restore "Add inkscape root directory to DLL search path"
See ecfc9efaf66d054fda239f48ef984190a89e6bae for details. This was dropped in db05b842cba28f01b431eee890537959aa2d8fe3 Partial fix for https://gitlab.com/inkscape/inkscape/issues/115
Diffstat (limited to 'src/inkscape-main.cpp')
-rw-r--r--src/inkscape-main.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/inkscape-main.cpp b/src/inkscape-main.cpp
index 998935a4b..a8499412c 100644
--- a/src/inkscape-main.cpp
+++ b/src/inkscape-main.cpp
@@ -10,14 +10,29 @@
* Released under GNU GPL v2+, read the file 'COPYING' for more information.
*/
+#ifdef _WIN32
+#include <windows.h> // provides SetDllDirectoryW
+#endif
+
#include "inkscape-application.h"
#include "path-prefix.h"
static void set_extensions_env()
{
+ // add share/inkscape/extensions to PYTHONPATH so the inkex module is found by extensions in user folder
gchar *pythonpath = get_extensions_path();
g_setenv("PYTHONPATH", pythonpath, true);
g_free(pythonpath);
+
+#ifdef _WIN32
+ // add inkscape directory to DLL search path so dynamically linked extension modules find their libraries
+ // should be fixed in Python 3.8 (https://github.com/python/cpython/commit/2438cdf0e932a341c7613bf4323d06b91ae9f1f1)
+ gchar *installation_dir = g_win32_get_package_installation_directory_of_module(NULL);
+ wchar_t *installation_dir_w = (wchar_t *)g_utf8_to_utf16(installation_dir, -1, NULL, NULL, NULL);
+ SetDllDirectoryW(installation_dir_w);
+ g_free(installation_dir);
+ g_free(installation_dir_w);
+#endif
}
int main(int argc, char *argv[])