Philipp Hörist pushed to branch master at gajim / gajim

Commits:
fe21ae60 by Philipp Hörist at 2018-10-23T20:58:49Z
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

- - - - -
9184c66e by Philipp Hörist at 2018-10-23T21:27:02Z
Fix Windows build

Appveyor adds ssl libs to the system folder which trips pythons ssl module

see https://github.com/appveyor/ci/issues/2571

- - - - -


2 changed files:

- appveyor.yml
- win/misc/create-launcher.py


Changes:

=====================================
appveyor.yml
=====================================
@@ -18,6 +18,8 @@ clone_depth: 1
 #   - ps: iex ((new-object 
net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
 
 build_script:
+  - del C:\Windows\System32\libssl-*.dll C:\Windows\system32\libcrypto-*.dll
+  - del C:\Windows\SysWOW64\libssl-*.dll C:\Windows\SysWOW64\libcrypto-*.dll
   - C:\msys64\usr\bin\pacman -Syuu --needed --noconfirm --noprogressbar 
--overwrite \\*
   - ps: |
         $env:TIME_STRING=(get-date -UFormat "%Y-%m-%d").ToString()


=====================================
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;
 }



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/compare/96653762474aa9ec05499bb8e3fe9072194e5fb5...9184c66eaec4558688e81c0b1eec34d7194aa482

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/compare/96653762474aa9ec05499bb8e3fe9072194e5fb5...9184c66eaec4558688e81c0b1eec34d7194aa482
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to