cztomczak / cefpython

Python bindings for the Chromium Embedded Framework (CEF)
Other
3.08k stars 473 forks source link

Example of packaging app using cx_Freeze #338

Open cztomczak opened 7 years ago

cztomczak commented 7 years ago

See https://anthony-tuininga.github.io/cx_Freeze/

See also:

josephmartin09 commented 6 years ago

I got somewhere with this one Windows. Happy to formalize this into a detailed example if needed.

Zip Installer is obtained by

python setup.py bdist

MSI Installer is obtained by

python setup.py bdist_msi
#setup.py
from distutils.sysconfig import get_python_lib
from os.path import join
from glob import glob
from cx_Freeze import setup, Executable

# Basically just copy all of the CEF distribution into the installer
# I have only tested this on windows
cefPath = join(get_python_lib(), "cefpython3")
CEF_INCLUDES = glob(join(cefPath, "*"))
CEF_INCLUDES.remove(join(cefPath, "examples"))

setup(
    name = "MyAppName",
    version = "1.0.0",
    options = {
        "build_exe": {
        'packages': ["os","sys","ctypes","win32con", "json"],
        'include_files': CEF_INCLUDES + ['otherResourceFolder'],
        'include_msvcr': True,
    }},
    executables = [Executable("app.py", base="Win32GUI")]
)
846948768 commented 5 years ago

@josephmartin09 In order to thank you, I specially registered this account, you are so powerful! thank you again~

Berserker66 commented 3 years ago

This appears to no longer work: [0511/153708.613:ERROR:icu_util.cc(172)] Invalid file descriptor to ICU data received. Completely deleting icudtl.dat gives the same error. Likely the path to the file is build in an incompatible way.

FeralFox commented 2 years ago

This appears to no longer work: [0511/153708.613:ERROR:icu_util.cc(172)] Invalid file descriptor to ICU data received.

I got the same error using PyInstaller.