Question

I'm compiling CEF (Chromium Embedded Framework) for our local html5 presentation. I should say I'm very new for all this (CEF and C++).

I've already optimized cefclient project for the presentation, but I need to embed all html/js/css/etc files into project (reading from local storage is not an option). As I understood, I should use .zip or .pak (renamed zip) files to embed. But how can I use them inside the project? Should I use some lib for unzipping (zlib?) or there is another popular way? And how can I be sure that files will be compiled into project?

Sorry for such basic questions but there are very few information about this (or google hates me today).

Thank you for any help!

UPD: found great tool - WBEA (http://asterclick.drclue.net/WBEA.html), it looks like exactly what I want to, but works pretty slow (with JS).

UPD 2: It turns out that there are many ways to make HTML5 desktop application, for example Node-Webkit. Here is an article that compares some of them http://clintberry.com/2013/html5-apps-desktop-2013/

Was it helpful?

Solution

You need:

  1. Create zip file whitin your resources.
  2. Embed it as win32 resource (after this step you will get correct executable with .zip file inside).
  3. Create custom scheme handler to access this zip file.

CefZipReader class will be handly to implement handler from step 3.

Look around, may be something like what you want already exist somewhere.

OTHER TIPS

This sounds very similar to self extracting installers.

No need to compile anything, just concatenate the zip to the end of the executable. All you need to do is find the offset at runtime from the start of the executable. This can be done easily by writing a large magic number and looking for it later.

Example Linux:

cat app magic_number data > new_app

Example Windows:

copy app.exe /B + magic.dat /B + data.dat /B new_app.exe
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top