How to detect Office 2019 programmatically?

前端 未结 4 692
长情又很酷
长情又很酷 2021-01-12 23:25

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 versi

4条回答
  •  深忆病人
    2021-01-13 00:21

    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.

提交回复
热议问题