Hello!
Case: in our program libs can be not exists on computer. In this case there are downloading libs from ftp, and then starting Chromium.
In CEF, when executing GlobalCEFApp.StartMainProcess without libs, we catching error 'CEF libraries is missing'.
In documenation, StartMainProcess must be called only on .dpr before Application.Initialize.
How we can call StartMainProcess after special event in our program, for example - on button click? We dont have necessary have necessity to store CEF libraries for each copy of our program, only when the user need it.
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.
Check libs before StartMainProcess
- salvadordf
- Posts: 4081
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Check libs before StartMainProcess
Hi,
Use a different EXE for the subprocesses and call GlobalCEFApp.StartMainProcess after your application has checked and downloaded the libraries.
You can use these functions in uCEFMiscFunctions.pas to check the CEF libraries manually :
https://github.com/salvadordf/CEF4Delph ... e.pas#L957
Use a different EXE for the subprocesses and call GlobalCEFApp.StartMainProcess after your application has checked and downloaded the libraries.
You can use these functions in uCEFMiscFunctions.pas to check the CEF libraries manually :
- CheckSubprocessPath
- CheckLocales
- CheckResources
- CheckDLLs
https://github.com/salvadordf/CEF4Delph ... e.pas#L957
Re: Check libs before StartMainProcess
"Use a different EXE for the subprocesses and call GlobalCEFApp.StartMainProcess after your application"
Is there some example? Is it mean I dont can use it in one EXE?
i.e. I have a frame, which opened in my application from menu. In this frame I have a CEFWindowParent, on which I show info from website. All of this must be in one window, but when I open frame - should be execute checking libs, downloading and creating browser on frame. Is it possible?
Is there some example? Is it mean I dont can use it in one EXE?
i.e. I have a frame, which opened in my application from menu. In this frame I have a CEFWindowParent, on which I show info from website. All of this must be in one window, but when I open frame - should be execute checking libs, downloading and creating browser on frame. Is it possible?
- salvadordf
- Posts: 4081
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Check libs before StartMainProcess
Sorry for the long delay.
If your application starts running, then checks the CEF libraries and downloads the libraries then you need to initialize CEF after the libraries are downloaded and decompressed.
In that case you need to configure GlobalCEFApp to use another EXE when Chromium needs to create another process.
There are several demos using this setting. Take a look at the "SubProcess" demo for more details.
If your application starts running, then checks the CEF libraries and downloads the libraries then you need to initialize CEF after the libraries are downloaded and decompressed.
In that case you need to configure GlobalCEFApp to use another EXE when Chromium needs to create another process.
There are several demos using this setting. Take a look at the "SubProcess" demo for more details.