.net 首次创建 MSI 安装程序

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5940342/
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-09-03 15:33:24  来源:igfitidea点击:

Creating an MSI installer for the first time

.netvisual-studio-2010installerwindows-installer

提问by Connor Albright

I need to make an msi installer for my very simple (no databases or anything) vb.net application in VS2010. I don't know anything about installers. Where do I start?

我需要为 VS2010 中非常简单(没有数据库或任何东西)的 vb.net 应用程序制作一个 msi 安装程序。我对安装程序一无所知。我从哪里开始?

回答by ShadowChaser

I would recommend taking a look at Windows Installer XML, commonly referred to as WiX. It's a bit more complicated than Visual Studio setup projects, but it allows you to treat your installer like source code.

我建议查看 Windows Installer XML,通常称为 WiX。它比 Visual Studio 安装项目复杂一点,但它允许您将安装程序视为源代码。

Makes longer term maintenance of installers easier than the GUI-based alternatives. Microsoft uses it to create many of their own installers.

使安装程序的长期维护比基于 GUI 的替代方案更容易。Microsoft 使用它来创建许多自己的安装程序。

It's available free here: http://wix.sourceforge.net/

它可以在这里免费获得:http: //wix.sourceforge.net/

A good tutorial for beginners is available here: http://www.tramontana.co.hu/wix/

这里有一个很好的初学者教程:http: //www.tramontana.co.hu/wix/

Be warned though, MSI has a somewhat steep learning curve. The biggest problem you'll probably face isn't with Windows Installer (MSI) itself, but the deployment of the .NET Framework to the target machines. There's no way to deploy .NET from within Windows Installer - you'll need a separate executable "bootstrapper" that installs .NET before the MSI can be launched.

不过请注意,MSI 的学习曲线有些陡峭。您可能面临的最大问题不是 Windows Installer (MSI) 本身,而是 .NET Framework 到目标机器的部署。无法从 Windows Installer 中部署 .NET - 您需要一个单独的可执行文件“引导程序”来安装 .NET,然后才能启动 MSI。

回答by IAmTimCorey

Here is a great walkthrough on how to create the setup project using the wizard:

以下是有关如何使用向导创建安装项目的精彩演练:

http://www.dreamincode.net/forums/topic/58021-deploying-a-c%23-application-visual-studio-setup-project/

http://www.dreamincode.net/forums/topic/58021-deploying-ac%23-application-visual-studio-setup-project/

回答by Jay

Visual studio has a separate kind of project you can create to make an installation for your application.

Visual Studio 有一种单独的项目,您可以创建它来为您的应用程序进行安装。