如何以编程方式检测Office 2019? [英] How to detect Office 2019 programmatically?

查看:132
本文介绍了如何以编程方式检测Office 2019?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们习惯于通过获取完整版本(例如从已安装的Office可执行文件的文件信息)来检测当前安装的Office版本,并将市长版本映射到友好名称,例如15映射到"Office 2013"​​,16到"Office 2016".

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".

但是,Office 2019的主要版本号没有更改.我们获得的版本号是16.0.10827.20138

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

是否存在将次要版本号映射到"Office 2019"的可靠方法?从哪个值开始,到2019年?有没有其他方法可以检测是否已安装Office 2019?

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?

"Office 2016"没有更多的小更新了吗?

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

推荐答案

从我们发现的结果来看,Office 2016、2019和Office 365的Office版本号/内部版本号可以相同.

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和2019应该具有冻结的功能集,而Office 365将使用新功能自动更新.在某些阶段,O365和其他内部版本号将重叠.我们还发现,安装了即点即用的Office 2016可能具有与2019年相同的内部版本号,尽管它只包含安全更新.

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.

安装了MSI的Office 2016将具有静态内部版本号. Office 2019没有MSI安装程序,这意味着它将自动更新,其内部版本号可能会与Office 365的内部版本增加相同的方式?

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?

无论如何:不再可能从内部版本号确定Office版本.我们还额外查询了以下注册表项:

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 

如果它不存在并且主要版本号是16,则它是Office 2016 MSI安装.

If it doesn't exist and the major version number is 16 it is an Office 2016 MSI install.

如果存在,则表明它是即点即用安装,您可以检查以下子项值,从中可以推断出2016、2019或365:

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 

示例值为"O36​​5ProPlusRetail"或"ProPlus2019Retail"或仅仅是"ProPlusRetail"

Example values are "O365ProPlusRetail" or "ProPlus2019Retail" or just "ProPlusRetail"

欢迎提出任何更好的建议.

Any better suggestions welcome.

这篇关于如何以编程方式检测Office 2019?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆