简体   繁体   English

将安装项目转换为Wix

[英]Convert Setup project to Wix

I have an application C#. 我有一个应用程序C#。 This application use a Project "Visual Studio Installer/Setup Project" for the setup. 此应用程序使用项目“ Visual Studio安装程序/安装项目”进行安装。 I have to change it for a "Windows Installer XML/Setup Project". 我必须为“ Windows Installer XML /安装项目”更改它。

The VS Installer use VS Installer的使用

  • a Custom Action 自定义动作
  • a class public partial class InstallerDB : System.Configuration.Install.Installer . public partial class InstallerDB : System.Configuration.Install.Installer Used to install the database 用于安装数据库
  • Maybe something else (I don't really understand how this installer Works" 也许还有其他原因(我不太了解此安装程序的工作原理”

I created a WiX project. 我创建了一个WiX项目。 In the product.wxs I added a call to the custom action. product.wxs我向自定义操作添加了一个调用。 But how can I call the project with the class InstallerDB ? 但是,如何使用InstallerDB类调用该项目?

And how can I be sure to do exactly the same setup ? 以及如何确定完全相同的设置?

WiX doesn't support installer class custom actions for many reasons, primarily because the Windows Installer team didn't support them and they arrived only in Visual Studio setup projects that Microsoft attempted to get rid of. WiX不支持安装程序类自定义操作的原因有很多,主要原因是Windows Installer团队不支持它们,并且它们仅出现在Microsoft试图摆脱的Visual Studio安装项目中。

WiX has its own support for managed code custom actions derived from the DTF effort to make them more acceptable for Windows Installer, so convert your custom action to this format. WiX自身支持从DTF派生的托管代码自定义操作,以使它们对于Windows Installer更为可接受,因此请将您的自定义操作转换为这种格式。 Examples are: 例如:

https://blogs.msdn.microsoft.com/jschaffe/2012/10/23/creating-wix-custom-actions-in-c-and-passing-parameters/ https://blogs.msdn.microsoft.com/jschaffe/2012/10/23/creating-wix-custom-actions-in-c-and-passing-parameters/

http://www.codeproject.com/Articles/132918/Creating-Custom-Action-for-WIX-Written-in-Managed http://www.codeproject.com/Articles/132918/Creating-Custom-Action-for-WIX-Written-in-Managed

If you install services with custom action installer classes then don't bother - WiX supports the built-in Windows Installer features to do this (which Visual Studio setups never did). 如果您使用自定义操作安装程序类安装服务,请不要打扰-WiX支持内置的Windows Installer功能来执行此操作(Visual Studio安装程序从未这样做)。 See the WiX ServiceInstall element, and ServiceControl for stopping and starting. 请参阅WiX ServiceInstall元素,以及有关停止和启动的ServiceControl。 The fact that Visual Studio setups use installer classes can give people the impression that they are required for installation of .NET services, but that's not the case. Visual Studio安装程序使用安装程序类的事实会给人一种安装.NET服务所需的印象,但事实并非如此。

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

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