Skip to content
Snippets Groups Projects
Commit 060332e3 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

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
parent 6b63d91f
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment