如何为 Windows 窗体应用程序创建安装程序和卸载程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6093893/
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
How to create an installer and uninstaller for a Windows Forms application
提问by user626660
I created an installer for my Windows Forms application and I added the project output to programs menu. But now what I want is 'I should have a folder in programs menu in that it should contain both install and uninstall options'.
我为我的 Windows 窗体应用程序创建了一个安装程序,并将项目输出添加到程序菜单中。但现在我想要的是“我应该在程序菜单中有一个文件夹,它应该包含安装和卸载选项”。
Please help me. Thanks in advance.
请帮我。提前致谢。
回答by Richard Schneider
The easiest way is to create a Setup and Deployment project in Visual Studio.
最简单的方法是在 Visual Studio 中创建一个安装和部署项目。
回答by abramlimpin
I have to agree with Sir Richard's answer, but I wanted to add the instructions on how add an uninstaller using the Setup and Deployment project found in Visual Studio.
我必须同意 Richard 爵士的回答,但我想添加有关如何使用 Visual Studio 中的安装和部署项目添加卸载程序的说明。
Here's a useful link you can work on: How to add a Uninstall option in Visual Studio Setup project without writing code
这是您可以使用的有用链接:如何在不编写代码的情况下在 Visual Studio 安装项目中添加卸载选项
回答by M84
You can try with NSIS, is open source and very easy...
您可以尝试使用 NSIS,它是开源的且非常简单...
"NSIS (Nullsoft Scriptable Install System) is a professional open source system to create Windows installers. It is designed to be as small and flexible as possible and is therefore very suitable for internet distribution."
“NSIS(Nullsoft Scriptable Install System)是一个专业的开源系统,用于创建 Windows 安装程序。它的设计尽可能小而灵活,因此非常适合互联网分发。”
in his website you can find tutorials and examples, the link is: http://nsis.sourceforge.net/Main_Page
在他的网站上你可以找到教程和例子,链接是:http: //nsis.sourceforge.net/Main_Page
I hope this help you!
我希望这对你有帮助!
回答by Richard Szalay
If you have advanced scenarios that the Setup and Deployment project can't handle, I'd advise looking into WiX.
如果您有设置和部署项目无法处理的高级方案,我建议您查看WiX。
WiX is an extremely mature Microsoft opensource project, having first launched in 2004 and is still active today. It even provides a VS extension to assist you with getting started and intellisense for the configuration.
WiX 是一个非常成熟的 Microsoft 开源项目,于 2004 年首次推出,今天仍然活跃。它甚至提供了一个 VS 扩展来帮助您入门和配置智能感知。
Be warned though: WiX primarily uses XML files that use MSI's domain language. It's certainly not a tool you use if "create an installer" wasn't allocated specifically in your project plan.
但请注意:WiX 主要使用使用 MSI 域语言的 XML 文件。如果您的项目计划中没有专门分配“创建安装程序”,那么它肯定不是您使用的工具。