diff --git a/bypy/windows/__main__.py b/bypy/windows/__main__.py index ecf642975b..3490f16cbc 100644 --- a/bypy/windows/__main__.py +++ b/bypy/windows/__main__.py @@ -128,10 +128,10 @@ def freeze(env, ext_dir, incdir): printf('\tAdding misc binary deps') - def copybin(x): - shutil.copy2(x, env.dll_dir) + def copybin(x, dest=env.dll_dir): + shutil.copy2(x, dest) with contextlib.suppress(FileNotFoundError): - shutil.copy2(x + '.manifest', env.dll_dir) + shutil.copy2(x + '.manifest', dest) bindir = os.path.join(PREFIX, 'bin') for x in ('pdftohtml', 'pdfinfo', 'pdftoppm', 'pdftotext', 'jpegtran-calibre', 'cjpeg-calibre', 'optipng-calibre', 'cwebp-calibre', 'JXRDecApp-calibre'): @@ -139,6 +139,10 @@ def freeze(env, ext_dir, incdir): for f in glob.glob(os.path.join(bindir, '*.dll')): if re.search(r'(easylzma|icutest)', f.lower()) is None: copybin(f) + ossm = os.path.join(env.dll_dir, 'ossl-modules') + os.mkdir(ossm) + for f in glob.glob(os.path.join(PREFIX, 'lib', 'ossl-modules', '*.dll')): + copybin(f, ossm) copybin(os.path.join(env.python_base, 'python%s.dll' % env.py_ver.replace('.', ''))) copybin(os.path.join(env.python_base, 'python%s.dll' % env.py_ver[0])) diff --git a/bypy/windows/util.c b/bypy/windows/util.c index 70f2abbe43..db889dd0d2 100644 --- a/bypy/windows/util.c +++ b/bypy/windows/util.c @@ -43,6 +43,8 @@ get_app_dirw(void) { static void get_install_locations(void) { get_app_dirw(); + _snwprintf_s(qt_prefix_dir, MAX_PATH-1, _TRUNCATE, L"%ls\\ossl-modules", interpreter_data.executables_path); + _wputenv_s(L"OPENSSL_MODULES", qt_prefix_dir); _snwprintf_s(qt_prefix_dir, MAX_PATH-1, _TRUNCATE, L"%ls\\app", interpreter_data.app_dir); _wputenv_s(L"CALIBRE_QT_PREFIX", qt_prefix_dir); } diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index 38a9107086..e3d976f5f8 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -1387,7 +1387,7 @@ def sanitize_env_vars(): 'LD_LIBRARY_PATH':'/lib', 'OPENSSL_MODULES': '/lib/ossl-modules', } elif iswindows: - env_vars = {} + env_vars = {'OPENSSL_MODULES': None} elif ismacos: env_vars = {k:None for k in ( 'FONTCONFIG_FILE FONTCONFIG_PATH SSL_CERT_FILE OPENSSL_ENGINES OPENSSL_MODULES').split()}