diff options
author | Philipp Hörist <philipp@hoerist.com> | 2018-10-22 23:57:37 +0300 |
---|---|---|
committer | Philipp Hörist <philipp@hoerist.com> | 2018-10-23 23:58:49 +0300 |
commit | fe21ae60866732dc0b8d8c382bc0075cebbfdffa (patch) | |
tree | cf798ed31adfe1fdfccd50879bf728914f1b4785 /win/misc | |
parent | 96653762474aa9ec05499bb8e3fe9072194e5fb5 (diff) |
Windows: Add folder to DLL search
This makes python look into the `bin` folder when searching for DLLs before
it trys C:\Windows or C:\Windows\system32 and potentially finds other versions of DLLs
Fixes #8968
Diffstat (limited to 'win/misc')
-rw-r--r-- | win/misc/create-launcher.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/win/misc/create-launcher.py b/win/misc/create-launcher.py index d6945d3e0..848ab0591 100644 --- a/win/misc/create-launcher.py +++ b/win/misc/create-launcher.py @@ -87,10 +87,15 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, Py_FrozenFlag = 1; Py_Initialize(); PySys_SetArgvEx(__argc, szArglist, 0); - result = PyRun_SimpleString("import sys; import os;" - "sys.frozen=True;" - "from gajim import gajim;" - "gajim.main();"); + result = PyRun_SimpleString( + "import sys; import os;" + "sys.frozen=True;" + "from pathlib import Path;" + "root_path = Path(sys.executable).parents[1];" + "from ctypes import windll;" + "windll.kernel32.SetDllDirectoryW(str(root_path / 'bin'));" + "from gajim import gajim;" + "gajim.main();"); Py_Finalize(); return result; } |