People who should know say not to use managed code custom actions in your Windows Installer setups. Like Rob Mensching of Wix fame who says:
…today the Windows Installer does not support managed code CustomActions and the general direction appears to be to try to reduce the need for CustomActions overall.
Read the blog entry for the reasons. The strange thing is, Visual Studio 2005 has specific support for managed code custom actions; there is an Installer class and an MSDN walkthrough on how to use it.
Now, I have always avoided managed code custom actions anyway, but only from instinct. Windows Installer setups are problematic enough as it is; adding .NET Framework dependency seems unnecessary. Mensching’s post above explains why it is also error-prone. See also Aaron Stebner’s post from March 2005.
… in summary, I strongly encourage you to not use managed code in your product setup. I realize that some teams do this here at Microsoft, but please don’t use our bad (in my opinion) examples to justify doing so in your own setup….
Presuming these guys are right, might it not be wise for the Visual Studio folk to remove support for managed code custom actions from the product? A point of confusion is that the managed installer class works with a utility called InstallUtil which is distinct from the Windows Installer; in fact, I believe that Visual Studio setup projects which include managed code custom actions actually call InstallUtil.
I suggest Delphi as a handy alternative, if you would rather avoid Visual C++.
Finally, I hear many good things about Wix, the free XML-based authoring too for Windows Installer setups. If you are embarking on a new setup project it is worth a look.
One thought on “More Windows Installer confusion: managed code custom actions a no-no”
Tim, for years I have been trying to convince VS to remove the Installer class since it is such an anti-pattern for quality installation. I obviously haven’t had any success. Once something is shipped by Microsoft it’s very, very, very difficult to get rid of it.
Comments are closed.