简体   繁体   English

从C#创建我自己的安装程序?

[英]Make my own Installer from C#?

I've been quite liking the new Installer's Microsoft have used, mainly for their Blend installations which use WPF, I'm wondering if I can make something like this for my application? 我一直很喜欢微软已经使用的新安装程序,主要是因为他们使用WPF的Blend安装,我想知道我是否可以为我的应用程序制作这样的东西?

The main worries are creating the Program Files Directory and registering the application with Windows so it adds it to the add/remove applications list. 主要担心是创建程序文件目录并使用Windows注册应用程序,以便将其添加到添加/删除应用程序列表中。

Is there anyone with a bit of experience on this? 有没有人对此有一点经验?

Thanks 谢谢

Microsoft have been using WiX with several of their installers and have managed to create some pretty funky, user friendly and accessible user interfaces. 微软一直在与他们的几个安装程序一起使用WiX,并设法创建一些非常时髦,用户友好和可访问的用户界面。 Examples of which include SQL Server and Microsoft Office. 其中的示例包括SQL Server和Microsoft Office。

It sounds like your installer doesn't need to do too much to the system, create a program files directory and install some files there. 听起来你的安装程序不需要对系统做太多,创建程序文件目录并在那里安装一些文件。 You are best off using Windows Installer to handle this, this is what it is built for, rather than rolling your own. 您最好使用Windows Installer来处理这个问题,这是它的基础,而不是自己编写。 You will get all of the functionality for coping with failures and rolling back safely out of the box. 您将获得应对故障的所有功能,并可立即安全地回滚。 The effort required to create a basic installer in WiX is truly minimal and adding a basic GUI is just as easy. 在WiX中创建基本安装程序所需的工作量非常小添加基本​​GUI也很简单。

You really should use a Windows Installer based tool because MSI does a lot of things write. 你真的应该使用基于Windows Installer的工具,因为MSI做了很多事情。 Things you'll be trying to learn from scratch ( for example you don't know about the Uninstall key in the registry and MsiPublishProduct does this for you ). 您将尝试从头开始学习的东西(例如,您不知道注册表中的卸载密钥和MsiPublishProduct为您执行此操作)。 If you want to work your chops on WPF you can always take your working installer ( let's say WiX ) and work up your own external UI handler using DTF and WPF. 如果你想在WPF上工作,你可以随时使用你的工作安装程序(比如说WiX)并使用DTF和WPF处理你自己的外部UI处理程序。

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

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