Search code examples
chromiumninja

Bundle a file in Chromium


I want to add an exe file in Chromium 88 and use c++ to execute it, but after run command

autoninja -C out\Default mini_installer

it showed error about wrong file path of exe file.

how can i put an exe file and bundle it in Chromium ?


Solution

  • To bundle a file in Chromium, you will have to modify src/chrome/installer/mini_installer/chrome.release. Here's how it looks like: https://source.chromium.org/chromium/chromium/src/+/master:chrome/installer/mini_installer/chrome.release;l=1?q=chrome.release&sq=&ss=chromium

    Just to make sure it's updatable when you update/upgrade your Chromium version on a user's machine, it should be placed inside VersionDir folder. For example in your case

    # Chrome version dir entries, sorted alphabetically.
    # Place your file here:
    chromium_foo_file.exe: %(VersionDir)s\
    

    For example if 88.0.0.0 is the version of your Chromium then after the installation is complete, this chromium_foo_file.exe will reside in 88.0.0.0 directory. Also place that file in your out\Default build folder before compiling mini_installer, so that it will be included automatically when building it