Installshield 2018中的.NET托管dll自定义操作 [英] .NET managed dll custom actions in Installshield 2018

查看:131
本文介绍了Installshield 2018中的.NET托管dll自定义操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Installshield 2018 Express版进行设置,我想包含一些用.NET编码的自定义操作,但是我找不到在.NET中引用自定义操作的方法。我猜想Installshield可以有一个选项来引用要为自定义操作调用的程序集,类和公共方法,但是我找不到任何选项可以做到这一点。

I am using Installshield 2018 Express edition to make my setup and I wanted to include some custom actions coded in .NET, but I can't find the way to reference a custom action in .NET. I guess Installshield would have an option to refer to the assembly, class and public method to be invoked for the custom action but I can't find any option to do that.

有什么办法可以做到这一点?我宁愿使用dll而不是exe,并且必须处理命令行args等。

¿Is there any way to achieve this? I'd prefer to use a dll instead of an exe and having to deal with the command line args, etc.

推荐答案

Express Edition :我不确定Installshield的Express版本是否支持自定义操作或Installscript(自定义操作脚本语言)? 我不认为 。实际上,它看起来确实没有,但是我没有这个产品。

Express Edition: I am not sure the Express edition of Installshield supports custom actions or Installscript (custom action scripting language)? I don't think it does. In fact it looks like it certainly does not, but I don't have the product in front of me.

选项 :我想您需要 1) 升级到更高版本, 2) 切换到其他产品或 3) 尝试注入(托管的)自定义操作DLL您可以从Installshield Express中进入已编译的MSI。

Options: I guess you either need to 1) upgrade to a higher edition, 2) switch to a different product or 3) try to "inject" a (managed) custom action DLL yourself into the compiled MSI from Installshield Express.

WiX Votive :这将是最佳猜测,而无需曾经尝试过生产。如果您使用> WiX的Votive功能 (WiX Toolset Visual Studio扩展),然后该项目将使用DTF将托管代码捆绑在看起来像本机DLL的dll中的方法进行编译。此生成的本机DLL应该可以顺畅地插入或注入到任何MSI软件包中(需要一些管道,需要摆弄一些小东西,但绝对不是火箭科学-如果您愿意的话,您将可以解决)。

WiX Votive: This will be "best guess" without having ever tried it for production. If you make a managed code custom action project using WiX's Votive feature (WiX Toolset Visual Studio Extension), then the project will compile using DTF's approach of bundling the managed code in a dll that looks like a native DLL. This resulting native DLL should be possible to slipstream or inject into any MSI package (some plumbing required, plenty of little fiddling to mess up, but definitely not rocket science - you will manage if you chose to).

MakeSfxCA.exe :请注意,从WiX托管代码项目中创建了两个dll。托管代码DLL,然后是带有附加CA的附加dll,附加到其相同名称的末尾。后一个CA版本是捆绑的本机DLL,它是您需要使用的版本。

MakeSfxCA.exe: Note that there are two dlls created from a WiX managed code project. The managed code DLL and then an additional dll with CA appended to the end of its otherwise identical name. This latter CA version is the bundled, native DLL - it is the one you need to use.

插入CA DLL :我进行了快速测试,能够将 WiX / DTF构建的DLL 注入另一种产品制成的包装中。您只需将DLL作为常规DLL自定义操作插入即可。这涉及将DLL添加到二进制表(有效负载),自定义操作表(自定义操作的配置)和InstallExecuteSequence或InstallUISequence表(或两者-取决于顺序)。后面的表格定义了自定义操作的顺序(运行时)。

Insert CA DLL: I ran a quick test and I was able to inject a WiX/DTF-built DLL into a package made by another product. You just insert the DLL as a regular DLL custom action. This involves adding the DLL to the binary table (payload), and the Custom Action table (the configuration of the custom action) and the InstallExecuteSequence or InstallUISequence tables (or both - depending on the sequencing). These latter tables define sequencing of the custom action (when it runs).

Orca,Direct Editor或CA View :如果Express版允许您定义自定义操作,请使用该方法并以这种方式添加DLL。如果它支持直接编辑器视图(表视图),则可以从那里开始。如果没有,带出Orca自己动手做。不是火箭科学,而是很多小细节,在您习惯之前就搞砸了。如您所知,这里有许多未知的地方-只是一个提示,可以帮助您真正地自助。希望我不要误入歧途。尽管可以凭经验在几分钟内完成,但如果您必须做保险杠到保险杠的样式,它很容易浪费一整天。

Orca, Direct Editor or CA View: If the Express edition lets you define custom actions, use that approach and add the DLL that way. If it supports a Direct Editor view (tables view) you might be able to do it from there. If not, bring out Orca and do it yourself. Not rocket science, but plenty of small details to mess up before you get used to it. As you understand there are a lot of unknowns for me here - just a tip to help you help yourself really. Hope I don't lead you astray. Though it can be done in minutes with experience, it can easily wastes a whole day if you have to do "bumper-to-bumper style".

托管代码CA :尽管大多数目标计算机都已安装.NET版本,但托管代码自定义操作仍存在一些令人恐惧的问题。我会推荐使用本机C ++ DLL代替-如果可以的话。托管代码的问题集中在运行时依赖项(锁定,丢失,运行时损坏),运行时版本干扰(已加载.NET版本),GAC依赖项问题(由于混合Fusion,您不能依赖于将程序集安装到GAC中) / MSI提交模型),等等... WiX致力于实现最佳实践,所以我不确定这些问题的严重程度是否可以说实话。

Managed Code CAs: There are some frightening problems associated with managed code custom actions, although we are reaching a stage when most target computers have a version of .NET installed. I would recommend a native C++ DLL instead - if that is an option. The problems with managed code center around runtime dependencies (locked, missing, broken runtime), runtime version interference (which .NET version is loaded), GAC dependency problems (you can't rely on assemblies being installed into the GAC due to mixed Fusion / MSI commit models), etc... WiX has worked to implement best practice, so I am not sure how bad these issues are anymore to be perfectly honest.

这篇关于Installshield 2018中的.NET托管dll自定义操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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