{"id":197,"date":"2007-04-21T14:24:19","date_gmt":"2007-04-21T13:24:19","guid":{"rendered":"http:\/\/www.itwriting.com\/blog\/?p=197"},"modified":"2007-04-21T14:24:19","modified_gmt":"2007-04-21T13:24:19","slug":"more-windows-installer-confusion-managed-code-custom-actions-a-no-no","status":"publish","type":"post","link":"https:\/\/www.itwriting.com\/blog\/197-more-windows-installer-confusion-managed-code-custom-actions-a-no-no.html","title":{"rendered":"More Windows Installer confusion: managed code custom actions a no-no"},"content":{"rendered":"<p>People who should know say not to use managed code custom actions in your Windows Installer setups. Like Rob Mensching of <a href=\"http:\/\/sourceforge.net\/projects\/wix\/\" target=\"_blank\">Wix<\/a> fame <a href=\"http:\/\/robmensching.com\/blog\/archive\/2007\/04\/19\/Managed-Code-CustomActions-no-support-on-the-way-and-heres.aspx\" target=\"_blank\">who says<\/a>:<\/p>\n<blockquote>\n<p>&#8230;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.<\/p>\n<\/blockquote>\n<p>Read the blog entry for the reasons. The strange thing is, Visual Studio 2005 has specific support for managed code custom actions; there is&nbsp;an Installer class and an <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/d9k65z2d(VS.80).aspx\" target=\"_blank\">MSDN walkthrough on how to use it<\/a>.&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.itwriting.com\/images\/installer.gif\"> <\/p>\n<p>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&#8217;s post above explains why it is also error-prone. See also&nbsp;Aaron Stebner&#8217;s <a href=\"http:\/\/blogs.msdn.com\/astebner\/archive\/2005\/03\/10\/392280.aspx\" target=\"_blank\">post from March 2005<\/a>.<\/p>\n<blockquote>\n<p>&#8230; in summary, I strongly encourage you to not use managed code in your product setup.&nbsp; I realize that some teams do this here at Microsoft, but please don&#8217;t use our&nbsp;bad (in my opinion)&nbsp;examples to justify doing so in your own setup&#8230;.<\/p>\n<\/blockquote>\n<p>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 <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/50614e95(vs.80).aspx\" target=\"_blank\">InstallUtil<\/a> 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.<\/p>\n<p>I suggest <a href=\"http:\/\/www.itwriting.com\/blog\/?p=109\" target=\"_blank\">Delphi<\/a> as a handy alternative, if you would rather avoid Visual C++.<\/p>\n<p>Finally, I hear many good things about <a href=\"http:\/\/wix.sourceforge.net\/index.html\" target=\"_blank\">Wix<\/a>, the free XML-based authoring too for Windows Installer setups. If you are embarking on a new setup project it is worth a look.<\/p>\n<p>&nbsp;<\/p>\n<div class=\"wlWriterSmartContent\" id=\"0767317B-992E-4b12-91E0-4F059A8CECA8:309fe883-87ba-4bce-a18e-15f91c7a739f\" contenteditable=\"false\" style=\"padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px\">Technorati tags: <a href=\"http:\/\/technorati.com\/tags\/msi\" rel=\"tag\">msi<\/a>, <a href=\"http:\/\/technorati.com\/tags\/installer\" rel=\"tag\">installer<\/a>, <a href=\"http:\/\/technorati.com\/tags\/custom%20actions\" rel=\"tag\">custom actions<\/a>, <a href=\"http:\/\/technorati.com\/tags\/wix\" rel=\"tag\">wix<\/a><\/div>\n<p><a title=\"http:\/\/wix.sourceforge.net\/index.html\" href=\"http:\/\/wix.sourceforge.net\/index.html\"><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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: &#8230;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 &hellip; <a href=\"https:\/\/www.itwriting.com\/blog\/197-more-windows-installer-confusion-managed-code-custom-actions-a-no-no.html\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">More Windows Installer confusion: managed code custom actions a no-no<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[80,97],"tags":[],"class_list":["post-197","post","type-post","status-publish","format-standard","hentry","category-software-development","category-windows"],"_links":{"self":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/comments?post=197"}],"version-history":[{"count":0,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/197\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/media?parent=197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/categories?post=197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/tags?post=197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}