检测是否安装了 Excel 2003 的最佳方法是什么?

发布于 2024-07-14 16:17:30 字数 144 浏览 4 评论 0原文

我正在使用 Wix v3.0(它可以归结为 MSI 安装程序),并且我正在尝试创建一个条件来确保安装了 Excel 2003。 检测计算机上是否存在 Excel 2003 的最佳(最可靠)方法是什么?

我看到了很多不同的建议,但没有明确或权威的答案。

I'm using Wix v3.0 (which boils down to an MSI installer) and I'm trying to author a condition to ensure that Excel 2003 is installed. What is the best (most robust) way to detect the presence of Excel 2003 on a machine?

I've seen lots of different suggestions, but no definitive or authoritative answer.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

兮子 2024-07-21 16:17:30

我在 Office 2003 工具包中找到了一个文件 Office 2003 密钥路径和默认安装设置工作簿,其中包含 Office 组件的所有 GUID。 基于此,我使用组件搜索来定位 Core Excel 组件。 在 WiX 中,我的情况如下所示:

    <Property Id="EXCEL2003INSTALLED">
      <!-- This is the Component Id of Global_Excel_Core -->
      <ComponentSearch Id="DetectExcel2003" Guid="{A2B280D4-20FB-4720-99F7-40C09FBCE10A}" Type="file"/>
    </Property>
    <Condition Message="This application requires Excel 2003 to be installed."><![CDATA[Installed OR EXCEL2003INSTALLED]]></Condition>

此页面具有其他 Office 应用程序和其他版本的组件指南。

I found a file in the Office 2003 toolkit, Office 2003 Keypath and Default Installation Settings workbooks that contains all the GUIDs for the Components of Office. Based on this, I used a Component Search to locate the Core Excel component. In WiX my condition looks like this:

    <Property Id="EXCEL2003INSTALLED">
      <!-- This is the Component Id of Global_Excel_Core -->
      <ComponentSearch Id="DetectExcel2003" Guid="{A2B280D4-20FB-4720-99F7-40C09FBCE10A}" Type="file"/>
    </Property>
    <Condition Message="This application requires Excel 2003 to be installed."><![CDATA[Installed OR EXCEL2003INSTALLED]]></Condition>

This page has Component Guids for other Office Apps and other versions.

月亮邮递员 2024-07-21 16:17:30

我们检查 InstallRoot 注册表项:(

HKLM\Software\Microsoft\Office\12.0\Excel\InstallRoot

将 12.0 替换为您的应用程序的相关版本号)。

请注意,在 64 位操作系统上,这将反映到注册表的 32 位部分(请参阅 这篇 Microsoft 文章 了解有关注册表反射的更多信息)。

这似乎至少适用于版本 2000、XP、2003、2007 和 2010。 2010 年的唯一变化是 64 位版本需要您查看注册表的 64 位部分。

We check the InstallRoot registry key at:

HKLM\Software\Microsoft\Office\12.0\Excel\InstallRoot

(Replace 12.0 with the relevant version number for your application).

Note that on 64-bit operating systems, this will be reflected to the 32-bit section of the registry (see this Microsoft article for more information on Registry Reflection).

This seems to work well for versions 2000, XP, 2003, 2007 and 2010 at least. The only change for 2010, is that the 64-bit version needs you to look in the 64-bit section of the registry.

逆光下的微笑 2024-07-21 16:17:30

您可以尝试检查注册表,或者也许是 Excel 的典型安装路径。

you could try checking the registry, or perhaps the typical install path for excel.

不必你懂 2024-07-21 16:17:30

Excel (Office) 也由 Windows 安装程序安装。
为什么不检查 Excel 组件代码?

Excel (Office) is also installed by windows installer.
Why are you not checking for the excel component codes?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文