Have you ever wondered how the AX Hotfix / Service Pack installer detects existing AOS instances?

These information can be found in the Installer Registry under the following Registry Key:

HKEY_CLASSES_ROOT\Installer\Products

Every AOS Instance has it's own class Id.
This class id looks like this FA15D12F8BB2D1C4282780DBCF31Axxx (where xxx is a uniqe number).

For example:
If I have 2 AOS instances on my machine then I may find the following registry keys:

HKEY_CLASSES_ROOT\Installer\Products\FA15D12F8BB2D1C4282780DBCF31A110
HKEY_CLASSES_ROOT\Installer\Products\FA15D12F8BB2D1C4282780DBCF31A120

Additional information
If those keys have a subkey named Patches then they are marked as updated.
The entries in this subkey contain information about the applied patches.