3

After building chromium from source, you can create a "mini installer" for Windows by running

ninja -C out\BuildFolder mini_installer

This works fine and creates a mini_installer.exe in out\BuildFolder.

But when I launch mini_installer.exe it just launches chromium. It doesn't open a nice installer interface.

So instead I am using InnoSetup to install the chromium files, and I'm not even using mini_installer.exe.

Can someone please describe what this "mini_installer" is supposed to accomplish? Can it prevent me from having to go through the trouble of making my own InnoSetup installer for my fork of Chromium?

Nicholas DiPiazza
  • 10,029
  • 11
  • 83
  • 152

1 Answers1

6

mini_installer is just a packer which packs the following files:

 1. CHROME.PACKED.7z
 2. setup.exe

These files should be present in your BuildFolder. CHROME.PACKED.7z packs Chrome.7z which includes your Chromium files and folders.

mini_installer will extract those two files to a temporary directory and then execute setup.exe. For instance if mini_installer.exe was executed with --system-level argument, it will pass those arguments to setup.exe:

"C:\Users\Username\AppData\Local\Temp\CWB_341A7.tmp\setup.exe" --install-archive="C:\Users\Username\AppData\Local\Temp\CWB_341A7.tmp\CHROME.PACKED.7Z" --system-level

That temporary folder name should be different for Chromium and Chrome cause we modified our fork to use CWB prefix

So, it's setup.exe which is responsible for the actual installation and uninstallation process. When you uninstall your Chromium fork setup.exe will be executed with the following arguments:

 C:\Program Files (x86)\YourChromium\Application\66.0.3359.139\Installer\setup.exe --uninstall --system-level

Note: if you pass --system-level then it will be installed for all the users.

The arguments you pass to mini_installer will be stored in registry so the same argument will be passed to setup.exe when you uninstall it. It should typically be stored here:

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\CompanyName\Update\ClientState\{Your-Chromium-fork-GUID} (for system-level installations)

The value of UninstallArguments and UninstallString will be read and used when uninstalling your Chromium fork.

Hope that helps

EDIT:

Just adding this info for anyone who might find this useful. There are various command line options for the installer which you can find here:

chrome\installer\util\master_preferences_constants.cc

Nicholas DiPiazza
  • 10,029
  • 11
  • 83
  • 152
Asesh
  • 3,186
  • 2
  • 21
  • 31
  • Yes this helps a lot. Question - what if I want some command line arguments added to chromium when it is started up (most importantly, logging). Is there a way to either A) tell mini_installer not to start chrome just install or B) can i tell it to always give chromium some sort of arguments? Because if it launches chromium right away I won't be able to see logging during "First Run = true" – Nicholas DiPiazza May 12 '18 at 13:10
  • 1
    Chromium already supports logging: https://www.chromium.org/for-testers/enable-logging You can add or modify existing command line arguments or switches too. Existing switches can be found here: ``src\chrome\common\chrome_switches.cc`` To add your own switch refer to the methods of base::CommandLine class: ``src\base\command_line.cc`` – Asesh May 12 '18 at 13:17
  • Sorry I wasn't clear. What I meant to ask was how can I get the `mini_installer.exe` to launch chrome with `--enable-logging --v=1` so that my first run has logging? – Nicholas DiPiazza May 12 '18 at 13:20
  • You should modify Chromium source code to do so. If you open this file: ``src\chrome\browser\first_run\first_run.cc``, there's a method ``IsChromeFirstRun`` which will return a boolean value indicating if it was first run or not. If it returns true then you can append that switch but then again you will have to modify Chromium source code. – Asesh May 12 '18 at 13:22
  • I think I found it. `chrome\installer\setup\setup_main.cc` has a `kDoNotLaunchChrome` option – Nicholas DiPiazza May 12 '18 at 13:26
  • 1
    BTW, if you pass ``--system-level`` argument then I am sure it won't launch Chromium. I might be wrong though but try it – Asesh May 12 '18 at 13:27
  • I created another question here https://stackoverflow.com/questions/50307180/chromium-mini-installer-ignores-branding can't seem to get this to respect my branding. – Nicholas DiPiazza May 12 '18 at 14:16
  • @Asesh I have a question about chromium auto-update with which you can help as I saw your post in chromium devs about this https://stackoverflow.com/questions/73710054/how-to-link-customized-chromium-fork-with-omaha – Obaid Ur Rehman Sep 13 '22 at 23:32