.NET managed dll custom actions in Installshield 2018

后端 未结 1 344
夕颜
夕颜 2021-01-22 07:35

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

相关标签:
1条回答
  • 2021-01-22 08:30

    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.

    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: 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: 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.

    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 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".

    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.

    0 讨论(0)
提交回复
热议问题