Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect Office 2019 programmatically?

We are used to detect the currently installed Office version by getting the full version (e.g. from the file info of an installed Office executable) and map the mayor version to a friendly name, like 15 maps to "Office 2013", 16 to "Office 2016".

However, there is no major version number change for Office 2019. The version number we get is 16.0.10827.20138

Is there a reliable way to map the minor version number to "Office 2019"? From which value onward will it be 2019? Is there another way to detect if Office 2019 is installed?

Are there no more minor updates to "Office 2016"?

like image 343
bgx Avatar asked Oct 19 '18 13:10

bgx


1 Answers

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.

like image 73
bgx Avatar answered Nov 10 '22 05:11

bgx