How to detect Office 2019 programmatically?
From what we have found out the Office version numbers/build numbers can be the same for Office 2016, 2019 and Office 365.
Office 2016 and 2019 are supposed to have frozen feature sets while Office 365 will auto-update with new features. At some stage O365 and other build numbers will overlap. We found also that Office 2016 installed with Click-to-Run may have the same build number as 2019, although it is meant to contain security updates only.
Office 2016 installed with MSI will have a static build number. There's no MSI installer for Office 2019, meaning it will auto-update and its build numbers might increase the same way as the ones for Office 365?
In any case: it is no longer possible to determine the Office version from the build number. We have resorted to look up the following registry key in addition:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun
If it doesn't exist and the major version number is 16 it is an Office 2016 MSI install.
If it exists, you know it's a Click-to-Run installation and you can examine the following subkey value from which you can infer 2016, 2019 or 365:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Configuration\ProductReleaseIDs
Example values are "O365ProPlusRetail" or "ProPlus2019Retail" or just "ProPlusRetail"
Any better suggestions welcome.