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
This commit is contained in:
parent
6b63d91fb6
commit
060332e319
|
@ -87,8 +87,13 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
|
|||
Py_FrozenFlag = 1;
|
||||
Py_Initialize();
|
||||
PySys_SetArgvEx(__argc, szArglist, 0);
|
||||
result = PyRun_SimpleString("import sys; import os;"
|
||||
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();
|
||||
|
|
Loading…
Reference in New Issue