C# 代码查找所有已安装的 Office 更新
在添加或删除程序中,您可以查看 MS Office Outlook 的更新/补丁列表。有没有办法使用 C# 代码获取此信息。我们尝试了 WMI 代码
const string query = "SELECT HotFixID FROM Win32_QuickFixEngineering";
var search = new ManagementObjectSearcher(query);
var collection = search.Get();
foreach (ManagementObject quickFix in collection)
Console.WriteLine(quickFix["HotFixID"].ToString());
这仅列出了 Windows 更新。有没有办法列出 Office 组件的更新?(适用于 Windows XP)
In add or remove programs you can view list of updates/patches for MS office Outlook. Is there a way to get this information using c# code. We tried WMI code
const string query = "SELECT HotFixID FROM Win32_QuickFixEngineering";
var search = new ManagementObjectSearcher(query);
var collection = search.Get();
foreach (ManagementObject quickFix in collection)
Console.WriteLine(quickFix["HotFixID"].ToString());
This only lists windows updates. Is there a way to list updates for office components?(for windows XP)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信您将必须使用注册表来获取这些。以下注册表项应该有所帮助:
您必须循环遍历 HKLM 和 HKCU 配置单元的值,以确保您拥有一切。然后,您可以对每个条目的 DisplayName 和 Publisher 进行过滤,以便仅获取 MS Office 补丁。
注意您还可以尝试查询Win32_Product 类获取 Windows 安装程序安装的产品。尽管我经常发现它没有列出您需要的所有内容(但是它可能足以解决您当前的问题 - 但我现在无法检查)。
I believe you will have to use the registry to get these. The following registry keys should help:
You will have to loop though both the values for the HKLM and HKCU hives in order to be sure you have everything. Then you can filter on DisplayName and Publisher for each entry in order to get only the MS office patches.
Note you could also try to query the Win32_Product class to get products installed by the Windows installer. Although I have often found that it does not list everything you need (however it might be sufficient for your current problem - but I am not in a position to check right now).