在C#安装程序中安装第三方应用程序

在C#安装程序中安装第三方应用程序

本文介绍了在C#安装程序中安装第三方应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在VS2010中创建了一个用于安装我的应用程序的安装程序,但它具有一些第三方必备条件,例如python。
我尝试将其他安装程序作为嵌入式资源包括在内,将它们提取为文件并运行(作为自定义操作)。它可以工作,但是似乎无法同时运行2个安装程序,因此从我的安装程序安装这些安装程序时,我会收到错误消息。

I've created an installer in VS2010 for installing my application, but it has some 3rd party prerequisites such as python.I've tried to include the additional installers as embedded resource, extract them as files and run them (as custom actions). It works, but seems like running 2 installers at the same time is impossible, so when these installers are installed from my installer, I get an error.

如何安装在我的应用程序安装过程中这些第三方应用程序?
(属性页中的先决条件无济于事,因为它们仅与.NET和sql server等ms内容相关...)

How can I install these 3rd party applications during my application installation?(The 'prerequisites' in the property pages are not helping, as they are only relevant for ms stuff such as .NET and sql server...)

谢谢!

推荐答案

您可以使用System.Diagnostics.Process。它可以在给定的路径上执行文件,例如MySQL服务器安装程序。 但是,您需要提供正如Ramhound在其评论中建议的那样,请看一下可以编写安装程序的商业产品。包括我个人最喜欢的Advanced Installer在内的一些工具提供了可能满足您最初要求的免费版本的工具。

you can use System.Diagnostics.Process for that. It can execute files on a given path, e.g. MySQL server installer. see this You would however need to supply the executable file.As Ramhound suggested in his comment, have a look at the commercial products to author your installer. Several, including my personal favorite Advanced Installer, offer free versions of the tool that may satisfy your initial requirements.

取决于打包必备组件(MSI或EXE)的方式,如果不使用自定义操作或引导程序,MSI可能无法直接安装prereq,该自定义操作或引导程序将在目标系统中搜索prereq并在目标系统上不存在的情况下进行安装。

Depending upon how the prerequisites are packaged (MSI or EXE) your MSI might not directly be able to install the prereq without the use of a custom action or a bootstrapper that would search the target system for the prereq and install it if it not present on the target system.

顺便说一句,除了我几年来一直是付费客户外,我与Advanced Installer没有任何隶属关系。除了优质的产品外,他们的服务也非常出色。

As an aside, I have no affiliation with Advanced Installer other than the fact that I've been a paying customer for a few years now. In addition to a solid product their service is excellent as well.

这篇关于在C#安装程序中安装第三方应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 23:40