How to execute a WiX custom action DLL file with dependencies(如何执行具有依赖关系的 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 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何执行具有依赖关系的 WiX 自定义操作 DLL 文件
基础教程推荐
- SonarQube C# 分析失败“不是指针的有效行偏移" 2022-01-01
- 将数据集转换为列表 2022-01-01
- 如果条件可以为空 2022-01-01
- 更新 Visual Studio 中的 DataSet 结构以匹配新的 SQL 数据库结构 2022-01-01
- 从 C# 控制相机设备 2022-01-01
- Mono https webrequest 失败并显示“身份验证或解密失败" 2022-01-01
- 获取C#保存对话框的文件路径 2022-01-01
- 重新排序 WPF TabControl 中的选项卡 2022-01-01
- 在 VB6 或经典 ASP 中使用 .NET 2022-01-01
- C# 9 新特性——record的相关总结 2023-04-03
