Hi,
I've never done that but I would try to set absolute paths for the CEF binaries in the GlobalCEFApp properties.
Edit : This may be a consequence of using LoadLibraryEx to load the DLLs from custom directories. Another solution would be to register your app in the registry as the default app for a custom file extension or protocol. You would only have to open an empty file with that extension and windows would execute your app without problems.
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.
Migrating from DCEF3, trying again
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
-
- Posts: 513
- Joined: Thu Aug 10, 2017 12:40 pm
Re: Migrating from DCEF3, trying again
The 'chdir' really did the trick. Maybe you would consider to do it inside the component source code, to avoid this problem in future versions.salvadordf wrote: Thu Oct 05, 2017 6:20 pm Hi,
I've never done that but I would try to set absolute paths for the CEF binaries in the GlobalCEFApp properties.
Edit : This may be a consequence of using LoadLibraryEx to load the DLLs from custom directories. Another solution would be to register your app in the registry as the default app for a custom file extension or protocol. You would only have to open an empty file with that extension and windows would execute your app without problems.
Here is my code :
chdir(extractfiledir(paramstr(0)));
Thanks !
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Migrating from DCEF3, trying again
Thanks!
I just added your code to TCefApplication.
Your code works in my local tests but I can't test all the possible combinations of library locations so I also added the TCefApplication.SetCurrentDir property to enable the chdir command.

I just added your code to TCefApplication.
Your code works in my local tests but I can't test all the possible combinations of library locations so I also added the TCefApplication.SetCurrentDir property to enable the chdir command.
-
- Posts: 513
- Joined: Thu Aug 10, 2017 12:40 pm
Re: Migrating from DCEF3, trying again
Great ! I'm glad to contributesalvadordf wrote: Fri Oct 06, 2017 2:44 pm Thanks!![]()
I just added your code to TCefApplication.
Your code works in my local tests but I can't test all the possible combinations of library locations so I also added the TCefApplication.SetCurrentDir property to enable the chdir command.

Re: Migrating from DCEF3, trying again
I've noticed a small issue with this, it would need to be done in or before the TCefApplication.CheckCEFLibrary function since at least in my case, the check fails when the working directory is different from the file path. I can get around it by disabling the file check but the checking would be nice to keep.salvadordf wrote: Fri Oct 06, 2017 2:44 pm Thanks!![]()
I just added your code to TCefApplication.
Your code works in my local tests but I can't test all the possible combinations of library locations so I also added the TCefApplication.SetCurrentDir property to enable the chdir command.
In my case this issue came up because my software can be launched from a custom protocol handler and then the working directory seems to be either system32 or user home directory. Otherwise my migration from DCEF3 has been surprisingly painless

- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Migrating from DCEF3, trying again
I'm glad all went well in your migration.430am wrote: Thu Jun 28, 2018 9:14 am I've noticed a small issue with this, it would need to be done in or before the TCefApplication.CheckCEFLibrary function since at least in my case, the check fails when the working directory is different from the file path. I can get around it by disabling the file check but the checking would be nice to keep.
In my case this issue came up because my software can be launched from a custom protocol handler and then the working directory seems to be either system32 or user home directory. Otherwise my migration from DCEF3 has been surprisingly painless![]()

Disable the checking and call CheckResources, CheckLocales and CheckDLLs manually with your custom directory.
Those functions are defined in uCEFMiscFunctions.pas
Re: Migrating from DCEF3, trying again
Oh, I didn't see those functions but I have an idea for a PR that'd fix this on the library side. I have my system setup so that the CEF3 resources are always with the binary and I'm trying to avoid specifying any directories in the code since this just means more headaches to separate between development and production.salvadordf wrote: Thu Jun 28, 2018 4:36 pmI'm glad all went well in your migration.430am wrote: Thu Jun 28, 2018 9:14 am I've noticed a small issue with this, it would need to be done in or before the TCefApplication.CheckCEFLibrary function since at least in my case, the check fails when the working directory is different from the file path. I can get around it by disabling the file check but the checking would be nice to keep.
In my case this issue came up because my software can be launched from a custom protocol handler and then the working directory seems to be either system32 or user home directory. Otherwise my migration from DCEF3 has been surprisingly painless![]()
![]()
Disable the checking and call CheckResources, CheckLocales and CheckDLLs manually with your custom directory.
Those functions are defined in uCEFMiscFunctions.pas
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Migrating from DCEF3, trying again
The PR was just merged!
Thanks!!!
Thanks!!!
