Custom Directories for Distributable Files
Posted: Thu Feb 23, 2023 2:56 pm
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
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
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;
...
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