Page 2 of 2

Re: Migrating from DCEF3, trying again

Posted: Thu Oct 05, 2017 6:20 pm
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.

Re: Migrating from DCEF3, trying again

Posted: Fri Oct 06, 2017 1:44 pm
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 !

Re: Migrating from DCEF3, trying again

Posted: Fri Oct 06, 2017 2:44 pm
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.

Re: Migrating from DCEF3, trying again

Posted: Fri Oct 06, 2017 4:21 pm
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

Re: Migrating from DCEF3, trying again

Posted: Thu Jun 28, 2018 9:14 am
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 :)

Re: Migrating from DCEF3, trying again

Posted: Thu Jun 28, 2018 4:36 pm
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

Re: Migrating from DCEF3, trying again

Posted: Tue Jul 03, 2018 12:00 pm
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.

Re: Migrating from DCEF3, trying again

Posted: Wed Jul 04, 2018 7:03 am
by salvadordf
The PR was just merged!

Thanks!!! :D