Questions regarding Chrome + automatic update

293 views
Skip to first unread message

Sebastian Onofrei

unread,
Jan 4, 2022, 4:26:44 AM1/4/22
to Chrome Updates Development
Hello guys, happy new year!

I'd like to implement automatic updates in a chromium-fork. Spent some time looking through code... but can't seem to figure it out.
So I have a few questions, if you're kind enough to enlighten me.

  • I assume that Chrome (at startup or something) connects to some URL to check if there are updates available? Figured out it's doing this in src\components\update_client\update_checker.cc so far. Managed to make it point to a test-webserver of mine and saw it sends some requests for updates, but mainly (as i saw now) for components and extensions?!
  • Also from what I've learned so far, an OMAHA intelligent update system can be integrated. Can you point me in the right direction?
    • which omaha webserver is best to use, if there are any. Meanwhile I've discovered there's one on github from omaha-consulting (a v2) and they also have a v3 for sale, but pricing is a lot considering what I do is not for profits
    • what's the mechanism of creating those delta-installers i've heard about

I hope to understand what's going on here :) Thanks.

Greg Thompson

unread,
Jan 4, 2022, 6:08:43 AM1/4/22
to Sebastian Onofrei, Chrome Updates Development
Hi.

Google Chrome is kept up-to-date by Google Update. The client component of Google Update is Google's proprietary build of Omaha (https://github.com/google/omaha) plus an update server run by Google. Google Update keeps Chrome up-to-date, while the component updater within the browser (the stuff in components/update_client) fetches and applies updates to components in the browser.

Google Chrome's delta update build scripts are not in the main Chromium repo, although chrome/tools/build/win/create_installer_archive.py looks like it has some logic to generate similar delta updates.

The Omaha folks likely have more to say.

Cheers

--
You received this message because you are subscribed to the Google Groups "Chrome Updates Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chrome-updates-...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chrome-updates-dev/acb1cc38-c892-454b-8a1b-8ba734f2c881n%40chromium.org.

Sebastian Onofrei

unread,
Jan 4, 2022, 7:02:01 AM1/4/22
to Chrome Updates Development, g...@chromium.org, Chrome Updates Development, Sebastian Onofrei
Hi Greg,

In other words (regarding the update server):
  • there's an update server run by Google - which is not OSSed
  • there's a v2 implementation from omaha-consulting (https://github.com/omaha-consulting/omaha-server) but as I saw, latest chromium codes runs on v3.1 and soon will use v4 or something.
  • omaha-consulting also has a v3-compliant updates server... but seen their costs, i cannot pay that for my reseatch at this moment :)
As I see, my only options are to write my own updates server?

As to the auto-update process. For many years I've known that there are task scheduled that will check for updates/etc - and will update chrome when a new version was released.
However, when you go in chrome://settings/help - that does a instant-check for updates as far as i know.
Doesn't that also interact with the main update server, just as the meta/installer?

Also, from what I've investigated in components/update_client - the json protocol exchanged there is valid Omaha protocol (v 3.1 i think) as described in https://github.com/google/omaha/blob/master/doc/ServerProtocol.md (except is JSON instead XML)

Greg Thompson

unread,
Jan 4, 2022, 7:15:28 AM1/4/22
to Sebastian Onofrei, Chrome Updates Development
See inline below for the one thing I can comment on.

Cheers

On Tue, Jan 4, 2022 at 1:02 PM Sebastian Onofrei <se...@onofrei.org> wrote:
Hi Greg,

In other words (regarding the update server):
  • there's an update server run by Google - which is not OSSed
  • there's a v2 implementation from omaha-consulting (https://github.com/omaha-consulting/omaha-server) but as I saw, latest chromium codes runs on v3.1 and soon will use v4 or something.
  • omaha-consulting also has a v3-compliant updates server... but seen their costs, i cannot pay that for my reseatch at this moment :)
As I see, my only options are to write my own updates server?

As to the auto-update process. For many years I've known that there are task scheduled that will check for updates/etc - and will update chrome when a new version was released.
However, when you go in chrome://settings/help - that does a instant-check for updates as far as i know.

Chrome asks Google Update to check for an update via some COM calls; see BeginUpdateCheck in chrome/browser/google/google_update_win.cc. We call this an "on-demand" update check. It's effectively the same thing that the scheduled task would do, but only for Chrome (not for all installed apps managed by Google Update).

Sebastian Onofrei

unread,
Jan 4, 2022, 8:17:47 AM1/4/22
to Chrome Updates Development, g...@chromium.org, Chrome Updates Development, Sebastian Onofrei
Yes, I remember also reading something about calling via COM. Been years though since I last played with COM, i remember that needs some registering (regsvr or something, if i remember correctly) - and this means that the chrome must be installed via the installer, right? (which will probably take care of that COM registering, creating the tasks in scheduler, registry paths such as Update/Clients and Update/ClientState, etc...

So at the end, it's the omaha-installer that deals with calling the update-server in both periodic and on-demand update-checks.

And this is on Windows. On MAC I read it has something to do with Sparkle ... which is also done via this Omaha installer?

Joshua Pawlicki

unread,
Jan 4, 2022, 10:08:22 AM1/4/22
to Sebastian Onofrei, Chrome Updates Development, g...@chromium.org
Hello. Chiming in on a few more details:

As background, Chrome is updated by Google Update (AKA "Omaha Client") on Windows and Google Software Update (AKA "Keystone") on macOS. Both of these client-side software stacks communicate with the same closed-source Google server systems using the Omaha protocol.

We are currently in the process of replacing both of these clients with a cross-platform client ("Chromium Updater") which is what you found in chromium's src/chrome/updater. The main risk of using Chromium Updater is that it's not completely ready yet (and Google has not yet migrated) and we may change things in disruptive ways. On the other hand, it should be easier to build and use if you're already capable of building your own fork of Chromium. On my home machines, Chromium Updater has been keeping Chrome up to date.


> As I see, my only options are to write my own updates server?
Yes, unfortunately. The protocol documents you linked should help you. If you base the update client on Google Update, you should parse the 3.0 protocol in XML; if you base it on chromium's src/chrome/updater code, you should use 3.1 in JSON. Although the protocol is fairly rich, the good news is that the minimal core update functionality isn't too complicated; you can see for example the little local server we use for tests here. For non-test code, you'll also want to implement the CUP elements of the protocol.

> On MAC I read it has something to do with Sparkle ... which is also done via this Omaha installer?
We don't use Sparkle, but rather Keystone, which is partially open-sourced (but what is OSS is very out of date, if I understand correctly). For macOS, I'd encourage you to use Chromium Updater (src/chromium/updater). Some contributors to the project have been using it successfully on macOS.


so...@chromium.org

unread,
Jan 4, 2022, 12:01:50 PM1/4/22
to Chrome Updates Development, Joshua Pawlicki, Chrome Updates Development, g...@chromium.org, Sebastian Onofrei
Without knowing anything about your project or its timeline, I second Joshua's opinion and I suggest developing your updater using the code at //chrome/updater instead of the open source Omaha fork. 

To unsubscribe from this group and stop receiving emails from it, send an email to chrome-updates-dev+unsub...@chromium.org.

Sebastian Onofrei

unread,
Jan 4, 2022, 12:10:09 PM1/4/22
to Chrome Updates Development, so...@chromium.org, Joshua Pawlicki, Chrome Updates Development, g...@chromium.org, Sebastian Onofrei
Thanks a lot for your feedback.
And to be honest, this starts to be my plan, especially after reading your comments, to implement the "Chromium updater".

As far as I've played with it, I see it makes some requests at startup, as following:

{"request":{"@os":"win","@updater":"","acceptformat":"crx3","app":[{"appid":"afalakplffnnnlkncjhbmahjfjhmlkal","enabled":true,"installsource":"ondemand","ping":{"ping_freshness":"{7cf95d45-a123-4c44-a79c-72e3a146cb71}","rd":5482},"updatecheck":{},"version":"0.0.0.0"}],"arch":"x64","dedup":"cr","domainjoined":false,"hw":{"physmemory":32},"ismachine":true,"lang":"","nacl_arch":"x86-64","os":{"arch":"x86_64","platform":"Windows","version":"10.0.19042.1052"},"prodchannel":"stable","prodversion":"97.1.34.73","protocol":"3.1","requestid":"{4ae563ee-5a74-429f-93a2-873a99eb6891}","sessionid":"{b61eefe7-8638-404a-b984-9c4644372055}","updaterchannel":"stable","updaterversion":"97.1.34.73"}}

As I understand (since I recognized some appids as being components/extensions, the above requests are related to browser's components/etc
Is there something I'd need to change in order to make it also ask for updates in a similar fashion about the main browser?

so...@chromium.org

unread,
Jan 4, 2022, 12:29:47 PM1/4/22
to Chrome Updates Development, Sebastian Onofrei, so...@chromium.org, Joshua Pawlicki, Chrome Updates Development, g...@chromium.org
On Tuesday, January 4, 2022 at 9:10:09 AM UTC-8 Sebastian Onofrei wrote:
Thanks a lot for your feedback.
And to be honest, this starts to be my plan, especially after reading your comments, to implement the "Chromium updater".

As far as I've played with it, I see it makes some requests at startup, as following:

{"request":{"@os":"win","@updater":"","acceptformat":"crx3","app":[{"appid":"afalakplffnnnlkncjhbmahjfjhmlkal","enabled":true,"installsource":"ondemand","ping":{"ping_freshness":"{7cf95d45-a123-4c44-a79c-72e3a146cb71}","rd":5482},"updatecheck":{},"version":"0.0.0.0"}],"arch":"x64","dedup":"cr","domainjoined":false,"hw":{"physmemory":32},"ismachine":true,"lang":"","nacl_arch":"x86-64","os":{"arch":"x86_64","platform":"Windows","version":"10.0.19042.1052"},"prodchannel":"stable","prodversion":"97.1.34.73","protocol":"3.1","requestid":"{4ae563ee-5a74-429f-93a2-873a99eb6891}","sessionid":"{b61eefe7-8638-404a-b984-9c4644372055}","updaterchannel":"stable","updaterversion":"97.1.34.73"}}

As I understand (since I recognized some appids as being components/extensions, the above requests are related to browser's components/etc
Is there something I'd need to change in order to make it also ask for updates in a similar fashion about the main browser?

We prefer running the updater stack in a program different than Chrome itself, so that we can still update Chrome when Chrome is broken. Technically, the component updater can be modified to update Chrome too, but there are issues to resolved when trying to update per-system installs of Chrome. The component updater does not have the privileges to update per-system installs of Chrome.

Sebastian Onofrei

unread,
Jan 4, 2022, 12:54:13 PM1/4/22
to Chrome Updates Development, so...@chromium.org, Sebastian Onofrei, Joshua Pawlicki, Chrome Updates Development, g...@chromium.org
I have no intentions to change component-updater in order to support browser-updates, so no problems :)

Now my big question: where can i find this special program's source code in chromium so that I start looking into it and is there a special configuration or something to enable building it? (asking this because I looked in the out dir, and wasn't able to find anything like updater.exe or GoogleUpdate.exe or anything similar.)

So far, i've looked in:
  • src/components/component_updater
  • src/components/update_client - here i saw that the components updater makes a call in update_checker which then runs the JSON parser on the received response from the Updater server - so this code should be related to components also
  • src/chrome/updater - is this the one?

Many thanks!

so...@chromium.org

unread,
Jan 4, 2022, 1:25:40 PM1/4/22
to Chrome Updates Development, Sebastian Onofrei, so...@chromium.org, Joshua Pawlicki, Chrome Updates Development, g...@chromium.org
On Tuesday, January 4, 2022 at 9:54:13 AM UTC-8 Sebastian Onofrei wrote:
I have no intentions to change component-updater in order to support browser-updates, so no problems :)

Now my big question: where can i find this special program's source code in chromium so that I start looking into it and is there a special configuration or something to enable building it? (asking this because I looked in the out dir, and wasn't able to find anything like updater.exe or GoogleUpdate.exe or anything similar.)

So far, i've looked in:
  • src/components/component_updater
This one is not related to the scope of your project, at least, not directly related right now. 
  • src/components/update_client - here i saw that the components updater makes a call in update_checker which then runs the JSON parser on the received response from the Updater server - so this code should be related to components also
This is the update stack which is used by the component and extensions updaters, and most importantly, by //chrome/updater, which is what is being discussed in this group.
  • src/chrome/updater - is this the one?
yes. 

I suggest taking a look at bit.ly/chromium-updater

When you build the code at //chrome/updater, an updater.exe program and its associated setup are created. Then you could use those to install an updater and update Chrome with it.

Sebastian Onofrei

unread,
Jan 11, 2022, 2:46:07 PM1/11/22
to Chrome Updates Development, so...@chromium.org, Sebastian Onofrei, Joshua Pawlicki, Chrome Updates Development, g...@chromium.org
Hello guys,

Is there a way to avoid implementing the CUP elements of the protocol and use plain HTTPS?

Many thanks.

Sorin Jianu

unread,
Jan 11, 2022, 3:43:47 PM1/11/22
to Sebastian Onofrei, Chrome Updates Development, Joshua Pawlicki, g...@chromium.org
On Tue, Jan 11, 2022 at 11:46 AM Sebastian Onofrei <se...@onofrei.org> wrote:
Hello guys,

Is there a way to avoid implementing the CUP elements of the protocol and use plain HTTPS?

Yeah, you could do changes in your fork to not instantiate CUP, or disable the CUP checks.
I don't think we have a programmable way to disable CUP otherwise.
Reply all
Reply to author
Forward
0 new messages