cefpython icon indicating copy to clipboard operation
cefpython copied to clipboard

Example of packaging app using cx_Freeze

Open cztomczak opened this issue 8 years ago • 4 comments
trafficstars

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

See also:

  • http://stackoverflow.com/questions/17389215/cefpython3-pyside-and-cx-freeze-cant-get-exe-working
  • http://stackoverflow.com/questions/27171646/cefpython-script-compiled-to-exe-fails-to-run

cztomczak avatar Mar 25 '17 05:03 cztomczak

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")]
)

josephmartin09 avatar Jun 19 '18 03:06 josephmartin09

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

846948768 avatar Jun 07 '19 08:06 846948768

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.

Berserker66 avatar May 11 '21 13:05 Berserker66

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.

FeralFox avatar Feb 17 '22 13:02 FeralFox