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

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

Re: Migrating from DCEF3, trying again

Post by salvadordf »

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.
thefunkyjoint
Posts: 460
Joined: Thu Aug 10, 2017 12:40 pm

Re: Migrating from DCEF3, trying again

Post by thefunkyjoint »

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.
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.

Here is my code :

chdir(extractfiledir(paramstr(0)));

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

Re: Migrating from DCEF3, trying again

Post by salvadordf »

Thanks! :D

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.
thefunkyjoint
Posts: 460
Joined: Thu Aug 10, 2017 12:40 pm

Re: Migrating from DCEF3, trying again

Post by thefunkyjoint »

salvadordf wrote: Fri Oct 06, 2017 2:44 pm Thanks! :D

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.
Great ! I'm glad to contribute :D
430am
Posts: 4
Joined: Tue Apr 03, 2018 2:39 pm

Re: Migrating from DCEF3, trying again

Post by 430am »

salvadordf wrote: Fri Oct 06, 2017 2:44 pm Thanks! :D

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'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 :)
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Migrating from DCEF3, trying again

Post by salvadordf »

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 :)
I'm glad all went well in your migration. :)

Disable the checking and call CheckResources, CheckLocales and CheckDLLs manually with your custom directory.
Those functions are defined in uCEFMiscFunctions.pas
430am
Posts: 4
Joined: Tue Apr 03, 2018 2:39 pm

Re: Migrating from DCEF3, trying again

Post by 430am »

salvadordf wrote: Thu Jun 28, 2018 4:36 pm
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 :)
I'm glad all went well in your migration. :)

Disable the checking and call CheckResources, CheckLocales and CheckDLLs manually with your custom directory.
Those functions are defined in uCEFMiscFunctions.pas
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.
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Migrating from DCEF3, trying again

Post by salvadordf »

The PR was just merged!

Thanks!!! :D
Post Reply