MCPcopy Create free account
hub / github.com/cztomczak/cefpython / copy_cpp_extension_dependencies_issue359

Function copy_cpp_extension_dependencies_issue359

tools/make_installer.py:339–416  ·  view source on GitHub ↗

CEF Python module is written in Cython and is a Python C++ extension and depends on msvcpXX.dll. For Python 3.5 / 3.6 / 3.7 / 3.8 / 3.9 msvcp140.dll is required. See Issue #359. For Python 2.7 msvcp90.dll is required. Etc. These dependencies are not included with Python binaries from

(pkg_dir)

Source from the content-addressed store, hash-verified

337
338
339def copy_cpp_extension_dependencies_issue359(pkg_dir):
340 """CEF Python module is written in Cython and is a Python C++
341 extension and depends on msvcpXX.dll. For Python 3.5 / 3.6 / 3.7 / 3.8 / 3.9
342 msvcp140.dll is required. See Issue #359. For Python 2.7
343 msvcp90.dll is required. Etc. These dependencies are not included
344 with Python binaries from Python.org."""
345 if not WINDOWS:
346 return
347
348 windows_dir = os.environ["SYSTEMROOT"]
349 if SYSTEM64:
350 system32 = os.path.join(windows_dir, "SysWOW64")
351 system64 = os.path.join(windows_dir, "System32")
352 else:
353 system32 = os.path.join(windows_dir, "")
354 system64 = None
355 if ARCH64:
356 system = system64
357 else:
358 system = system32
359
360 root_search_paths = []
361
362 # Need to check for .pyd files for all Python version, because
363 # the builder/installer work in a way that previous cefpython
364 # module builds for other Python versions are also included
365 # in the package. Thus if included, msvcpxx.dll dependency is
366 # required as well.
367
368 # Python 3.5 / 3.6 / 3.7 / 3.8 / 3.9
369 if os.path.exists(os.path.join(pkg_dir, "cefpython_py35.pyd")) \
370 or os.path.exists(os.path.join(pkg_dir, "cefpython_py36.pyd")) \
371 or os.path.exists(os.path.join(pkg_dir, "cefpython_py37.pyd")) \
372 or os.path.exists(os.path.join(pkg_dir, "cefpython_py38.pyd")) \
373 or os.path.exists(os.path.join(pkg_dir, "cefpython_py39.pyd")):
374 search_paths = [
375 # This is where Microsoft Visual C++ 2015 Update 3 installs
376 # (14.00.24212).
377 os.path.join(system, "msvcp140.dll"),
378 ]
379 root_search_paths.append(search_paths)
380
381 # Python 3.4
382 if os.path.exists(os.path.join(pkg_dir, "cefpython_py34.pyd")):
383 search_paths = [
384 # 10.00.40219.325 installs here on my system.
385 os.path.join(system, "msvcp100.dll"),
386 ]
387 root_search_paths.append(search_paths)
388
389 # Python 2.7
390 if os.path.exists(os.path.join(pkg_dir, "cefpython_py27.pyd")):
391 if ARCH32:
392 search_paths = [
393 # This runtime version is shipped with Python 2.7.14
394 r"c:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b"
395 r"_9.0.30729.1_none_e163563597edeada\msvcp90.dll",
396 ]

Callers 1

mainFunction · 0.85

Calls 1

copyMethod · 0.80

Tested by

no test coverage detected