Skip to content

⚠ Extra information

Simon Tushev edited this page Aug 15, 2021 · 5 revisions

ℹ These notes are mostly a self-reminder, however, they may be useful to others.

Basic app algorithm

When AJUpdateWatcher.exe is started, it performs the following steps:

  1. Check for scheduled task-related command line option, like -deletetask. Execute them if present, exit immediately after (no further steps).
  2. Check/try upgrading own settings from the previous versions
  3. Check for self (AJUpdateWatcher) updates. If there is an update and user agrees - proceed with it (leave this list).
  4. Load local settings, list of installations etc. Show disclaimers etc.
  5. If app considers itself as 'not configured' or there is -config parameter - open Configuration window (leave this list).
  6. Otherwise, perform a check for updates for a list of configured AdoptOpenJDK installations:
    1. If there are AdoptOpenJDK updates => Show them to the user
    2. If there is no updates:
      1. On the first run or on start menu shortcut (since 2.0.1.0) => Show message that there are no updates
      2. On the second and further invocations (or on start menu shortcut, pre-2.0.1.0) => Silently terminate

So, if you click on the .exe and nothing happens - this is OK, this is not a bug. It means that the app went through the following steps: 1 → 6 → ii → b. There were no updates, and there are no other messages to show, so nothing is shown.

Update check algorithm

There are two types of installations: manually configured ones and auto-discovered.

Every time the app checks for the updates, if performs the following steps:

  1. Get a fresh list of auto-discovered at this very moment installations (via Windows Registry). In Configuration Window, this happens only when setting the checkboxes, on start, or on UpdatesInstallationComplete event.
  2. Get a list of user-configured updates. Check if some of these override some auto-discovered ones.
  3. For each enabled (by checkbox) installation:
    1. Try to obtain local version:
      1. For auto-discovered installations, get MSIRevision field via Registry, all other fields - via release file (as described below).
      2. For manually-added installations, get all fields from release file: process JAVA_VERSION → FULL_VERSION → SEMANTIC_VERSION fields, if present. Parse them, fill fields.
    2. Get latest version from API.
    3. If latest version is not marked as skipped by user, compare local and API versions:
      1. Major (Feature)
      2. Minor (Interim)
      3. Security (Update)
      4. Either compare
        • local:MSIRevision vs api:semver.build - if MSIRevision is present and only if API version is newer (added in 2.0.3)
        • Or continue comparing:
          1. Patch
          2. Build
          3. AdoptBuild
    4. If API version is newer, suggest to update.

Registry keys

The following registry keys are enumerated - in both x32 and x64 registry views and in both HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER:

  • SOFTWARE\AdoptOpenJDK
  • SOFTWARE\Eclipse Foundation
  • SOFTWARE\Temurin
  • SOFTWARE\Semeru

https://github.com/tushev/aojdk-updatewatcher/blob/master/src/Classes/Adoptium/AdoptiumInstallationsDiscoverer.cs#L21

registry