简体   繁体   English

如何在应用程序启动时检测计算机上是否安装了MS Runtime或Office?

[英]How to detect if MS Runtime or Office is installed on computer on application stratup?

I have a WinForm program developed in VB.Net with Visual Studio 2005. The program needs Microsoft Office Runtime installed atleast on the computer to allow the application to run without any errors. 我有一个用Visual Studio 2005在VB.Net中开发的WinForm程序。该程序需要在计算机上至少安装Microsoft Office Runtime,以允许该应用程序运行而没有任何错误。

Is their a way to check the computer to see if the minimum of the Runtime or Microsoft Office is installed on the computer? 他们是否可以检查计算机以查看计算机上是否安装了最低限度的运行时或Microsoft Office? If either isn't I would like to display a message to the user on the startup of the application that states to atleast go to Microsot's site (I have full link to Runtime Download) and download the runtime for free. 如果不是,那么我想在应用程序启动时向用户显示一条消息,指出至少要转到Microsot的站点(我具有“运行时下载”的完整链接)并免费下载运行时。

Or is their a way to include the runtime as a component with my install for the application so if it isn't installed on the computer already it will install when the application is installed? 还是他们将运行时作为组件包含在我的应用程序安装中的一种方法,以便如果尚未将其安装在计算机上,则将在安装应用程序时安装它?

Thanks 谢谢

If you more specific details please specify the exact runtime you are interested in. Office has lots of them. 如果您需要更具体的详细信息,请指定您感兴趣的确切运行时。Office有很多此类。

For a launch condition you can try this approach: 对于启动条件,可以尝试以下方法:

  • select your setup project in solution explorer 在解决方案资源管理器中选择设置项目
  • go to its Launch Conditions Editor 转到其启动条件编辑器
  • create a registry search which determines if the runtime is installed or not 创建一个注册表搜索,以确定是否安装了运行时
  • create a new launch condition 创建一个新的启动条件
  • add the registry search property as the condition 将注册表搜索属性添加为条件

This way the installation stops and shows the message you specify if the search doesn't find anything. 这样,安装会停止,并在搜索未找到任何内容时显示您指定的消息。

Another approach is to include the runtime as a prerequisite: 另一种方法是将运行时包括在内作为先决条件:

  • select your setup project in Solution Explorer 在解决方案资源管理器中选择安装项目
  • right-click it and select Properties context menu 右键单击它,然后选择“属性”上下文菜单
  • click Prerequisites button in the property page 单击属性页面中的先决条件按钮
  • check the prerequisite you want 检查所需的先决条件

If the prerequisite you want is not in this list, you will have to configure it manually . 如果所需的前提条件不在此列表中,则必须手动进行配置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM