如何检测MS-Office的安装版本? [英] How to detect installed version of MS-Office?

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

问题描述

有没有人知道什么是检测哪个版本的Office的最佳方法?另外,如果有多个版本的Office安装,我想知道他们是什么版本。如果我可以检测到安装的(/))的特定版本,那么奖金就是。

解决方案

检查安装的Office版本的方法是检查感兴趣的Office应用程序的 InstallRoot 注册表项。



例如,如果您想检查是否安装了Word 2007,则应检查以下注册表项是否存在:

  HKLM\Software\Microsoft\Office\12.0\Word\InstallRoot :: Path 

此条目包含可执行文件的路径。



将12.0(对于Office 2007)替换为相应的版本号:

 
Office 97 - 7.0
Office 98 - 8.0
Office 2000 - 9.0
Office XP - 10.0
Office 2003 - 11.0
Office 2007 - 12.0
Office 2010 - 14.0(sic!)
Office 2013 - 15.0
Office 2016 - 16.0

其他应用程序有类似的键:

  HKLM\Software\Microsoft\Office\12.0 $ \\ $ \\ $ p> 

或者您可以检查所有应用程序的通用根路径:

  HKLM\Software\Microsoft\Office\12.0\Common\InstallRoot :: Path 

另一个选项,不使用特定的注册表项将是使用 MSIEnumProducts API查询MSI数据库,如 here



另外,不同Office版本的并行安装不是正式的由微软支持他们有些工作,但你可能会产生不良影响和不一致。


Does anyone know what would be the best way to detect which version of Office is installed? Plus, if there are multiple versions of Office installed, I'd like to know what versions they are. A bonus would be if I can detect the specific version(s) of Excel that is(/are) installed.

解决方案

One way to check for the installed Office version would be to check the InstallRoot registry keys for the Office applications of interest.

For example, if you would like to check whether Word 2007 is installed you should check for the presence of the following Registry key:

HKLM\Software\Microsoft\Office\12.0\Word\InstallRoot::Path

This entry contains the path to the executable.

Replace 12.0 (for Office 2007) with the corresponding version number:

Office 97   -  7.0
Office 98   -  8.0
Office 2000 -  9.0
Office XP   - 10.0
Office 2003 - 11.0
Office 2007 - 12.0
Office 2010 - 14.0 (sic!)
Office 2013 - 15.0
Office 2016 - 16.0

The other applications have similar keys:

HKLM\Software\Microsoft\Office\12.0\Excel\InstallRoot::Path
HKLM\Software\Microsoft\Office\12.0\PowerPoint\InstallRoot::Path

Or you can check the common root path of all applications:

HKLM\Software\Microsoft\Office\12.0\Common\InstallRoot::Path

Another option, without using specific Registry keys would be to query the MSI database using the MSIEnumProducts API as described here.

As an aside, parallel installations of different Office versions are not officially supported by Microsoft. They do somewhat work, but you might get undesired effects and inconsistencies.

这篇关于如何检测MS-Office的安装版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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