Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Custom Directories for Distributable Files

Post Reply
miket@cbofks.com
Posts: 21
Joined: Tue Aug 03, 2021 7:23 pm

Custom Directories for Distributable Files

Post by miket@cbofks.com »

Greetings Salvador,

Back on July 30, 2019 I installed CEF 74.1.16 and chose to use custom directories for the files that needed to be distributed with my application.

I set the custom directories in the CreateGlobalCEFApp procedure

Code: Select all

procedure CreateGlobalCEFApp;

  procedure SetCefLibPath;
  var
    strAppDir: String;
    strCefPath: String;
  begin
    strAppDir := IncludeTrailingPathDelimiter(RecurseDir(ExtractFilePath(Application.ExeName), 2));

    {$IFDEF WIN32}
      strCefPath := strAppDir + 'CefDistributables\Lib32';
    {$ENDIF}

    {$IFDEF WIN64}
      strCefPath := strAppDir + 'CefDistributables\Lib64';
    {$ENDIF}

    GlobalCEFApp.FrameworkDirPath := strCefPath;
    GlobalCEFApp.ResourcesDirPath := strCefPath;
    GlobalCEFApp.LocalesDirPath := strCefPath + '\Locales';

    GlobalCEFApp.SetCurrentDir := True;
  end;
begin
  GlobalCEFApp := TCefApplication.Create;

  SetCefLibPath;

  //* Enable hardware acceleration
  GlobalCEFApp.EnableGPU := True;
  ...
These are the directories
GlobalCEFApp.FrameworkDirPath := ‘C:\Frontline\CefDistributables\Lib32’
GlobalCEFApp.ResourcesDirPath := ‘C:\Frontline\CefDistributables\Lib32’
GlobalCEFApp.LocalesDirPath := ‘C:\Frontline\CefDistributables\Lib32\Locales'

For the CEF 74.1.16 build I placed the following files in these directories to distribute with my application
C:\Frontline\CefDistributables\Lib32\cef.pak
C:\Frontline\CefDistributables\Lib32\cef_100_percent.pak
C:\Frontline\CefDistributables\Lib32\cef_200_percent.pak
C:\Frontline\CefDistributables\Lib32\cef_extensions.pak
C:\Frontline\CefDistributables\Lib32\cef_sandbox.lib
C:\Frontline\CefDistributables\Lib32\chrome_elf.dll
C:\Frontline\CefDistributables\Lib32\d3dcompiler_47.dll
C:\Frontline\CefDistributables\Lib32\devtools_resources.pak
C:\Frontline\CefDistributables\Lib32\icudtl.dat
C:\Frontline\CefDistributables\Lib32\libcef.dll
C:\Frontline\CefDistributables\Lib32\libEGL.dll
C:\Frontline\CefDistributables\Lib32\libGLESv2.dll
C:\Frontline\CefDistributables\Lib32\natives_blob.bin
C:\Frontline\CefDistributables\Lib32\snapshot_blob.bin
C:\Frontline\CefDistributables\Lib32\v8_context_snapshot.bin
15 Files

C:\Frontline\CefDistributables\Lib32\locales\am.pak
C:\Frontline\CefDistributables\Lib32\locales\ar.pak
C:\Frontline\CefDistributables\Lib32\locales\bg.pak
C:\Frontline\CefDistributables\Lib32\locales\bn.pak
C:\Frontline\CefDistributables\Lib32\locales\ca.pak
C:\Frontline\CefDistributables\Lib32\locales\cs.pak
C:\Frontline\CefDistributables\Lib32\locales\da.pak
C:\Frontline\CefDistributables\Lib32\locales\de.pak
C:\Frontline\CefDistributables\Lib32\locales\el.pak
C:\Frontline\CefDistributables\Lib32\locales\en-GB.pak
C:\Frontline\CefDistributables\Lib32\locales\en-US.pak
C:\Frontline\CefDistributables\Lib32\locales\es-419.pak
C:\Frontline\CefDistributables\Lib32\locales\es.pak
C:\Frontline\CefDistributables\Lib32\locales\et.pak
C:\Frontline\CefDistributables\Lib32\locales\fa.pak
C:\Frontline\CefDistributables\Lib32\locales\fi.pak
C:\Frontline\CefDistributables\Lib32\locales\fil.pak
C:\Frontline\CefDistributables\Lib32\locales\fr.pak
C:\Frontline\CefDistributables\Lib32\locales\gu.pak
C:\Frontline\CefDistributables\Lib32\locales\he.pak
C:\Frontline\CefDistributables\Lib32\locales\hi.pak
C:\Frontline\CefDistributables\Lib32\locales\hr.pak
C:\Frontline\CefDistributables\Lib32\locales\hu.pak
C:\Frontline\CefDistributables\Lib32\locales\id.pak
C:\Frontline\CefDistributables\Lib32\locales\it.pak
C:\Frontline\CefDistributables\Lib32\locales\ja.pak
C:\Frontline\CefDistributables\Lib32\locales\kn.pak
C:\Frontline\CefDistributables\Lib32\locales\ko.pak
C:\Frontline\CefDistributables\Lib32\locales\lt.pak
C:\Frontline\CefDistributables\Lib32\locales\lv.pak
C:\Frontline\CefDistributables\Lib32\locales\ml.pak
C:\Frontline\CefDistributables\Lib32\locales\mr.pak
C:\Frontline\CefDistributables\Lib32\locales\ms.pak
C:\Frontline\CefDistributables\Lib32\locales\nb.pak
C:\Frontline\CefDistributables\Lib32\locales\nl.pak
C:\Frontline\CefDistributables\Lib32\locales\pl.pak
C:\Frontline\CefDistributables\Lib32\locales\pt-BR.pak
C:\Frontline\CefDistributables\Lib32\locales\pt-PT.pak
C:\Frontline\CefDistributables\Lib32\locales\ro.pak
C:\Frontline\CefDistributables\Lib32\locales\ru.pak
C:\Frontline\CefDistributables\Lib32\locales\sk.pak
C:\Frontline\CefDistributables\Lib32\locales\sl.pak
C:\Frontline\CefDistributables\Lib32\locales\sr.pak
C:\Frontline\CefDistributables\Lib32\locales\sv.pak
C:\Frontline\CefDistributables\Lib32\locales\sw.pak
C:\Frontline\CefDistributables\Lib32\locales\ta.pak
C:\Frontline\CefDistributables\Lib32\locales\te.pak
C:\Frontline\CefDistributables\Lib32\locales\th.pak
C:\Frontline\CefDistributables\Lib32\locales\tr.pak
C:\Frontline\CefDistributables\Lib32\locales\uk.pak
C:\Frontline\CefDistributables\Lib32\locales\vi.pak
C:\Frontline\CefDistributables\Lib32\locales\zh-CN.pak
C:\Frontline\CefDistributables\Lib32\locales\zh-TW.pak
53 Files

C:\Frontline\CefDistributables\Lib32\swiftshader\libEGL.dll
C:\Frontline\CefDistributables\Lib32\swiftshader\libGLESv2.dll
2 Files

Going forward, I want to be able to simply copy the contents of the release folder to C:\Frontline\CefDistributables\Lib32\Release\ and copy the contents of the resource folder to C:\Frontline\CefDistributables\Lib32\Resources\. So, my question is, does the following look correct?
GlobalCEFApp.FrameworkDirPath := ‘C:\Frontline\CefDistributables\Lib32\Release’
GlobalCEFApp.ResourcesDirPath := ‘C:\Frontline\CefDistributables\Lib32\Resources’
GlobalCEFApp.LocalesDirPath := ‘C:\Frontline\CefDistributables\Lib32\Resources\Locales'

Lastly, in order to update my application to point to this new directory structure, while continuing to use the CEF 74.1.16 build, can I make the following assumptions?

All files in C:\Frontline\CefDistributables\Lib32\locales\ should be moved to C:\Frontline\CefDistributables\Lib32\Resources\locales\
The 15 files in C:\Frontline\CefDistributables\Lib32\ should be moved to C:\Frontline\CefDistributables\Lib32\Release\
What do I do with the 2 files in C:\Frontline\CefDistributables\Lib32\swiftshader\?

Appreciate any guidance to aid me in getting the directories and files straightened out to use the old binaries before moving to the new binaries.

[Update] I decided to try and move all of the old binaries to the revised directory structure and stated with moving all the Locales files first. I then started my app and it appears that any missing file including the path is displayed in a warning message so I was able to move all the rest of the files into the appropriate directories. After doing so, I started my application in debug mode and there was a warning in the event messages:

Debug Output:
[0223/093458.729:FATAL:v8_initializer.cc(176)] Failed to open V8 file 'C:\Frontline\CefDistributables\Lib32\Release\natives_blob.bin' (reason: -4)

According to the CEF binaries missing dialog, the natives_blob.bin file should be placed into C:\Frontline\CefDistributables\Lib32\Resources directory, which I did, so since this error message states it's looking for it in the Release directory, I moved it there. Trying to compile again, I received the CEF binaries missing dialog again stating The missing miles are: C:\Frontline\CefDistributables\Lib32\Resources\natives_blob.bin. The only way to get pass either of these errors is to place natives_blob.bin in both directories. The app does start up now without any errors, but, if I try to go to a webpage it is now blank, so don't know if that is because of having natives_blob.bin in two places.

Thanks,
Mike
User avatar
salvadordf
Posts: 4056
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Custom Directories for Distributable Files

Post by salvadordf »

Hi,

The CEF binaries have changed significantly since CEF 74.

Not only the number of files have changed in CEF 110 but also the directory structure. Chromium has some hardcoded dependencies and we are not allowed to move all the files freely.

If you want to be safe I would recommend that you move all the binaries the C:\Frontline\CefDistributables\Lib32 directory like this :
Image
That image includes the "MiniBrowser.exe" demo but you should not distribute it with your application.

Then set this values in GlobalCEFApp :

Code: Select all

  GlobalCEFApp.FrameworkDirPath     := 'C:\Frontline\CefDistributables\Lib32';
  GlobalCEFApp.ResourcesDirPath     := 'C:\Frontline\CefDistributables\Lib32';
  GlobalCEFApp.LocalesDirPath       := 'C:\Frontline\CefDistributables\Lib32\locales';
Read this for all the information about the GlobalCEFApp properties. It's outdated but most of the information is still relevant :
https://www.briskbard.com/index.php?lang=en&pageid=cefapp

This is the latest documentation in the CEF API docs :
https://cef-builds.spotifycdn.com/docs/110.0/structcef__settings__t.html
miket@cbofks.com
Posts: 21
Joined: Tue Aug 03, 2021 7:23 pm

Re: Custom Directories for Distributable Files

Post by miket@cbofks.com »

Thanks Salavdord,

I did all as you described on my development computer, all is fine, my app runs as it should. I had a user log onto my computer to make sure they agree.

Then I decided to update the server. I archived the last good build of CollectingIT.exe and CEFSubProcess.exe, as well as the old CEF binaries on another drive on the server (drive G). I then placed the new CEF binaries on K:\Frontline\CefDistributables, updated the CollectingIT.exe and CEFSubProcess.exe to the new version.

When I try to start my application on the server, I get an error message, then CollectingIT promptly shuts down.

The error:
"Entry Point Not Found"
The procedure entry point NetFreeAadJoinInformation could not be located in the dynamic link library
K:\Frontline\CefDistributables\Lib32\libcef.dll

That file is in the folder and dated 2/25/2023 5:43am

Any ideas?
Mike

PS: I cannot seem to figure out how to load an image file off my computer to this board. How do you do it?
User avatar
salvadordf
Posts: 4056
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Custom Directories for Distributable Files

Post by salvadordf »

miket@cbofks.com wrote: Sat Feb 25, 2023 9:03 pm When I try to start my application on the server, I get an error message, then CollectingIT promptly shuts down.
The error:
"Entry Point Not Found"
The procedure entry point NetFreeAadJoinInformation could not be located in the dynamic link library
K:\Frontline\CefDistributables\Lib32\libcef.dll
That file is in the folder and dated 2/25/2023 5:43am
Any ideas?
Mike
This could be caused by the new Chromium requirements since the 110 version.
https://www.briskbard.com/forum/viewtopic.php?p=8845#p8845

Google announced that Chromium 110 will only support Windows 10 or greater.
https://support.google.com/chrome/thread/185534985/sunsetting-support-for-windows-7-8-1-in-early-2023?hl=en
This means that Windows 7, 8/8.1, Windows Server 2012, and Windows Server 2012 R2 are not supported by Chromium 110.

If you need to support Windows 7 then use this CEF4Delphi release :
https://github.com/salvadordf/CEF4Delphi/releases/tag/109.0.5414.120
miket@cbofks.com wrote: Sat Feb 25, 2023 9:03 pm PS: I cannot seem to figure out how to load an image file off my computer to this board. How do you do it?
Use a free image hosting service and then put the image link using the "Picture" icon in the message editor.
miket@cbofks.com
Posts: 21
Joined: Tue Aug 03, 2021 7:23 pm

Re: Custom Directories for Distributable Files

Post by miket@cbofks.com »

Ah, that's it. Our Windows Server is 2012 R2, so I downloaded and use v109.0.5414.120. Now it works on both my Windows 10 and Windows Server 2012 R2 Computers. Salvadord, thanks so much for your help with this. We do have a new windows server ready to go, I have just not got to that point yet.

Thanks,
Mike
Post Reply