如何执行具有依赖关系的 WiX 自定义操作 DLL 文件 [英] How to execute a WiX custom action DLL file with dependencies

查看:23
本文介绍了如何执行具有依赖关系的 WiX 自定义操作 DLL 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个依赖于第三方 .NET DLL(在这种特定情况下,它是 MySql.Data.dll).我有 C# 自定义操作 DLL 文件与下面的 WiX 片段一起使用.我只是想弄清楚如何安全地将依赖项添加到自定义操作中.注意:我实际上并不需要这个第三方 DLL 文件来运行已安装的应用程序.

I want to create a CustomAction C# DLL file that depends on a third-party .NET DLL (in this specific case, it's MySql.Data.dll). I have the C# custom action DLL file working with the WiX fragment below. I'm just trying to figure out how to safely add a dependency to the custom action. Note: I don't actually need this third-party DLL file file for the installed application to run.

  <Binary Id="MyCustomAction.dll" SourceFile="MyCustomAction.CA.dll" />

  <CustomAction Id="FixupConfigForMysql" Return="check" />

  <InstallExecuteSequence>
     <Custom Action='FixupConfigForMysql' After='InstallFiles'>NOT Installed</Custom>
  </InstallExecuteSequence>

是否需要安装第三方 DLL 文件 (MySql.Data.dll) 才能运行自定义操作?

Do I need to install the third-party DLL file (MySql.Data.dll) in order to get the custom action to run?

我可以在第三方 DLL 文件中添加另一个二进制标签吗?

Can I just add another Binary tag with the third-party DLL file?

推荐答案

WiX 工具集中的 DTF 具有一种机制,可以将您的自定义操作程序集及其所有引用包含到单个二进制文件中(基本上是自解压 dll).我不编写托管的自定义操作(C/C++ 创建的自定义操作具有较少的依赖项并提高了成功率),但它应该只在 VS 中构建时工作.

DTF in the WiX toolset has a mechanism to include your custom action assembly and all of its references into a single binary (self-extracting dll, basically). I don't write managed custom actions (C/C++ creates custom actions with fewer dependencies and increases success rate) but it is supposed to just work when building in VS.

这篇关于如何执行具有依赖关系的 WiX 自定义操作 DLL 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆