Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I use DLL's and Resource files in another folder? #13

Closed
rubinho241180 opened this issue Feb 13, 2017 · 5 comments
Closed

How can I use DLL's and Resource files in another folder? #13

rubinho241180 opened this issue Feb 13, 2017 · 5 comments

Comments

@rubinho241180
Copy link

rubinho241180 commented Feb 13, 2017

Hi,
How can I use dlls and resource files in different EXE folder?

Like this:

  CefCache := 'cef\__cache';
  CefLibrary := 'cef\libcef.dll';
  CefResourcesDirPath := 'cef\';
  CefLocalesDirPath   := 'cef\locales\';


I tried this bu don't work:

  GlobalCEFApp.Library := 'cef\libcef.dll'; <---- ???? This property "Library" do not exists
  GlobalCEFApp.FrameworkDirPath := 'cef\';
  GlobalCEFApp.ResourcesDirPath := 'cef\';
  GlobalCEFApp.LocalesDirPath   := 'cef\locales\';

In my project structure I separated my main EXE from another files (DLLs/resources).

Thank you!!!

@salvadordf
Copy link
Owner

salvadordf commented Feb 14, 2017

Download CEF4Delphi again. I just added your suggestion and now you can set a customized location for libcef.dll using the GlobalCEFApp.LibCef property. Thanks! 😄

About the FrameworkDirPath, the CEF3 source comments say this about that parameter (cef_settings_t.framework_dir_path) :

The path to the CEF framework directory on macOS.

Marshall Greenblatt also said this at the CEF3 forum :

The expected path for icudtl.dat and *.bin files is hard-coded in Chromium and cannot be configured.

http://magpcss.org/ceforum/viewtopic.php?f=6&t=14873&p=33742#p33742

Be careful moving those files beacuse you could have crashes in your application.

@raelb
Copy link

raelb commented Feb 14, 2017

Can you describe how this function should be used?

In my .dpr file I have:

GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.LibCef := 'cef\libcef.dll';
GlobalCEFApp.ResourcesDirPath := 'cef\';
GlobalCEFApp.LocalesDirPath := 'cef\locales\';

My dir structure is as follows:

Exe folder:

cef [folder]
guiclient.exe
icudtl.dat
natives_blob.bin
snapshot_blob.bin

Cef subfolder:

locales
cef.pak
cef_100_percent.pak
cef_200_percent.pak
cef_extensions.pak
chrome_elf.dll
d3dcompiler_43.dll
d3dcompiler_47.dll
devtools_resources.pak
libcef.dll
libcef.lib
libEGL.dll
libGLESv2.dll
widevinecdmadapter.dll

I receive CEF binaries missing when I run the app.

@salvadordf
Copy link
Owner

I made some more tests setting GlobalCEFApp.CheckCEFFiles := False; to skip the file checking and it seems that the only files you can move safely are the locales. The moment you try to use another directory for the resources or the DLLs you'll get a crash in CEF3 initialization.

@rubinho241180
Copy link
Author

rubinho241180 commented Feb 14, 2017

Before, I used "https://github.com/hgourvest/dcef3" (very old) and I cold do it like this:

CefLibrary          := 'cef\libcef.dll';
CefResourcesDirPath := 'cef\';
CefLocalesDirPath   := 'cef\locales\';

I wanna to separate my main executable from the other cef files, like this:

[app] <= this is app folder.
     app.exe
     [cef] <= this is cef files folder.
          cef_files.*
          [locales] <= this is cef locales folder.
               locales_files.*

And all my distributed projects are working this way, is it just like the dcef3 I mentioned, could you add that possibility?

Very Thanks!!!!,

@salvadordf
Copy link
Owner

salvadordf commented Feb 15, 2017

After some more test I could move a few more files but you have to use absolute paths. With this settings you can move all but 5 files.
GlobalCEFApp.FrameworkDirPath := 'k:\cef'; // FULL PATH
GlobalCEFApp.ResourcesDirPath := 'k:\cef'; // FULL PATH
GlobalCEFApp.LocalesDirPath := 'k:\cef\locales'; // FULL PATH

K: is a custom drive unit. Use whatever you want as long as it's a full path.

The files that I couldn't move from the application directory were : icudtl.dat, natives_blob.bin, snapshot_blob.bin, libcef.dll and chrome_elf.dll.

I could move all the *.pak files, locales and the rest of the DLLs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants