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.

Strange crash with .. dots in FrameWorkDirPath or ResourcesDirPath

Post Reply
JanDoggen
Posts: 12
Joined: Thu Sep 19, 2019 11:34 am

Strange crash with .. dots in FrameWorkDirPath or ResourcesDirPath

Post by JanDoggen »

- CEF4Delphi is in C:\DelphiLibs\CEF4Delphi-master, so the VCL demos are in C:\DelphiLibs\CEF4Delphi-master\demos\Delphi_VCL\
- The CEF3 files are copied into C:\DelphiLibs\CEF4Delphi-master\demos\Delphi_VCL\cef3

This works:

GlobalCEFApp.FrameworkDirPath := 'C:\DelphiLibs\CEF4Delphi-master\demos\Delphi_VCL\cef3';
GlobalCEFApp.ResourcesDirPath := GlobalCEFApp.FrameworkDirPath;
GlobalCEFApp.LocalesDirPath := GlobalCEFApp.FrameworkDirPath + '\locales';

This fails with an access violation:

GlobalCEFApp.FrameworkDirPath := 'C:\DelphiLibs\CEF4Delphi-master\demos\Delphi_VCL\SimpleBrowser\..\cef3';
GlobalCEFApp.ResourcesDirPath := GlobalCEFApp.FrameworkDirPath;
GlobalCEFApp.LocalesDirPath := GlobalCEFApp.FrameworkDirPath + '\locales';

The error occurs in
GlobalCEFApp.StartMainProcess -> SingleExeProcessing -> InitializeLibrary(TempApp) on the cef_initialize call

Side note:
What I originally intended to do for several demo projects is:

var
lCurrDir: String;

begin
lCurrDir := ExtractFilePath(ParamStr(0));
GlobalCEFApp.FrameworkDirPath := lCurrDir + '\..\cef3';

This is CEF4Delphi version 76.1.13 (?, downloaded 18 sep)
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Strange crash with .. dots in FrameWorkDirPath or ResourcesDirPath

Post by salvadordf »

Thanks for reporting this issue! :)

I just uploaded the fix for this bug to GitHub. Please, download CEF4Delphi again.
JanDoggen
Posts: 12
Joined: Thu Sep 19, 2019 11:34 am

Re: Strange crash with .. dots in FrameWorkDirPath or ResourcesDirPath

Post by JanDoggen »

I downloaded the 23/9 ZIP but still get the error
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Strange crash with .. dots in FrameWorkDirPath or ResourcesDirPath

Post by salvadordf »

I just uploaded a new version and it canonicalizes relative and absolute paths now.

Please, download CEF4Delphi from GitHub again.
Post Reply