从 c# setup 项目运行另一个程序

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/663835/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-04 12:24:02  来源:igfitidea点击:

Running another program from c# setup project

c#windowsdeploymentinstallation

提问by Anirudh Goel

I have made a setup and deployment project in C#, Now i have another windows update exe which i want to run and install successfully before it installs my project. I've packaged the exe with my project. How may i run that exe before?

我已经在 C# 中创建了一个安装和部署项目,现在我有另一个 Windows 更新 exe,我想在它安装我的项目之前成功运行和安装它。我已经将 exe 与我的项目打包在一起。我之前怎么运行那个exe?

采纳答案by JaredPar

You want to add a Custom Action to the Setup Project that runs the executable. This WalkThrough will take you through getting htat working.

您想向运行可执行文件的安装项目添加自定义操作。本演练将带您了解如何让 htat 工作。

http://msdn.microsoft.com/en-us/library/d9k65z2d(VS.80).aspx

http://msdn.microsoft.com/en-us/library/d9k65z2d(VS.80).aspx

回答by Dirk Vollmar

Any other package that should be installed before your own MSI file must be installed by the setup bootstrapper (i.e. the setup.exe file). In order to do so, you should right-click on your setup project, select properties and then pre-requisites. The dialog will list you the components which can be installed by the bootstrapper.

应该在您自己的 MSI 文件之前安装的任何其他软件包必须由安装引导程序(即 setup.exe 文件)安装。为此,您应该右键单击您的安装项目,选择属性,然后选择先决条件。该对话框将列出引导程序可以安装的组件。

Now, if the component you want to install is in this list, you are done. Otherwise you have to dig deeper into the mechanism of the bootstrapper. Every item in the list has an associated package description stored under

现在,如果您要安装的组件在此列表中,您就完成了。否则,您必须深入了解引导程序的机制。列表中的每个项目都有一个关联的包描述存储在

C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages

for VS 2005 or

对于 VS 2005 或

C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages

for VS 2008. This package definition basically contains instructions on what to install, how to obtain the component (download url) and how to check whether an installation is necessary.

对于 VS 2008。这个包定义基本上包含关于安装什么、如何获取组件(下载 url)以及如何检查是否需要安装的说明。

For custom components you can create your own package definition. If you don't want to do it manually, you can use the Bootstrapper Manifest Generator.

对于自定义组件,您可以创建自己的包定义。如果您不想手动执行,可以使用Bootstrapper Manifest Generator

EDIT: If you don't want to go the rather complex but powerful way using the boostrapper you might want to have a look at IExpress. This is a free tool included with MS Windows that allows you to create a self-extracting installation package consisting of multiple components and executing a custom script. IExpress has a graphical UI, but also have a look at the created .sed file for further options.

编辑:如果您不想使用 boostrapper 使用相当复杂但功能强大的方式,您可能想看看 IExpress。这是 MS Windows 中包含的免费工具,允许您创建由多个组件组成的自解压安装包并执行自定义脚本。IExpress 有一个图形用户界面,但也可以查看创建的 .sed 文件以获取更多选项。