Skip to content

Before you run the demos

Salvador Díaz Fau edited this page Sep 6, 2024 · 11 revisions

All CEF4Delphi applications need the CEF libraries and some other data files in order to run.

The "readme.md" file in this project has several links to the CEF binaries with all those files.

32 bits applications for Windows will use the CEF binaries found in the "Windows 32 bits" link, while the 64 bits applications for Windows will use the CEF binaries in the "Windows 64 bits" link.

Linux applications require the CEF binaries available in the links starting with "Linux" and they also have to use the appropiate link depending on the CPU type (x86/ARM) and bitness (32/64).

Once you have downloaded the CEF binaries package you'll need to decompress it. In the case of Windows and Linux you have to copy the contents of the "Release" and "Resources" directories inside the "bin" directory of CEF4Delphi.

All the demos create the executable file inside the "bin" directory and the final layout looks like this in Windows :

cef4delphi layout

In Linux it looks like this :

cef4delphi layout

MacOS app bundles must have the right directory structure and contents. In this case you have to decompress the CEF binaries package and copy the contents of the "Release/Chromium Embedded Framework.framework" directory into the "appname.app/Contents/Frameworks/Chromium Embedded Framework.framework/" directory.

Additionally, you the MacOS demos need to have 5 helpers inside the "appname.app/Contents/Frameworks/" directory with the following names :

  • appname Helper.app
  • appname Helper (GPU).app
  • appname Helper (Plugin).app
  • appname Helper (Renderer).app
  • appname Helper (Alerts).app

The final layout of a MacOS app bundle with the CEF binaries and the 4 helpers looks like this :

appname.app/
Contents/
    Frameworks/
        Chromium Embedded Framework.framework/
            Chromium Embedded Framework
            Libraries/
                libEGL.dylib
                libGLESv2.dylib
                libswiftshader_libEGL.dylib
                libswiftshader_libGLESv2.dylib
                libvk_swiftshader.dylib
                vk_swiftshader_icd.json
            Resources/
                chrome_100_percent.pak
                chrome_200_percent.pak
                resources.pak.pak
                Info.plist
                icudtl.dat
                snapshot_blob.bin
                v8_context_snapshot.x86_64.bin
                en.lproj/
                    locale.pak
                es.lproj/ 
                    locale.pak
                ****.lproj/ 
                    locale.pak
        appname Helper.app/
            Contents/
                Info.plist
                MacOS/
                    appname Helper 
                Pkginfo
        appname Helper (GPU).app/
            Contents/
                Info.plist
                MacOS/
                    appname Helper (GPU)
                Pkginfo
        appname Helper (Plugin).app/
            Contents/
                Info.plist
                MacOS/
                    appname Helper (Plugin) 
                Pkginfo
        appname Helper (Renderer).app/
            Contents/
                Info.plist
                MacOS/
                    appname Helper (Renderer) 
                Pkginfo
        appname Helper (Alerts).app/
            Contents/
                Info.plist
                MacOS/
                    appname Helper (Alerts) 
                Pkginfo
    Info.plist
    MacOS/
        appname
    Pkginfo
    Resources/
        binding.html, ... 

Additional notes :

  • If you copy the "Debug" directory instead of the "Release" directory you will have unexpected issues.
  • CEF evolves quickly and each CEF4Delphi version needs a specific version of the CEF binaries. Always use the links in the "readme.md" file to download the right CEF binaries.
  • The CEF binaries for Linux include the debug symbols. This is useful for debugging but it's necessary to remove them in the final build by executing this command in a Linux console window : strip libcef.so . Removing the debug symbols from the CEF binaries for Linux will reduce their size considerably and they will also load much faster.
Clone this wiki locally