Skip to content

Application registration

Kirill Yakovenko edited this page Oct 16, 2017 · 2 revisions

The application must be registered according to Omaha Client rules. The application registration mechanism is based on Windows registry. There are primarily two update policies supported by Omaha, which directly affect how Omaha Client aware application registers with the Omaha runtime:

  • per-machine updates
  • per-user updates

In the case of per-machine updates, each application installed per-machine creates the HKLM/Software/{OmahaCompanyName}/Update/Clients/{GUID} key. Under this key, the application creates the following values:

  • pv (current product version - e.g. 1.0.20.0)
  • name (ignored but useful for debugging)

In the case of per-user updates, the only difference is the location to where the key is created. In this case, the key is HKCU/Software/{OmahaCompanyName}/Update/Clients/{GUID}.

When the update loop kicks in, Omaha runs the per-machine updates as SYSTEM and per-user updates as the logged in user. This assumes that the user has an active session, in other words, updates for per-user installed applications will not run if the user has not logged in. As long as there is anything under these keys, Omaha keeps pinging for updates and updating these applications. It is possible that the application is dead and its registration with Omaha still active, for example, in the case where the user just deleted the application files. Unfortunately, Omaha does not detect such conditions, and it is going to download and apply updates for it until the application cleanly is unregistered.

Exposing registry keys and low-level implementation details to applications has disadvantages. It breaks the encapsulation of Omaha. An argument can be made that such implementation details would be better to be abstracted out in a code library that the application code links with. However, there is a great advantage for the current registration mechanism. Registry keys can be created quickly and directly from the installer script for applications that are using off the shelf installer technology thus making the integration with Omaha easier.