{"id":740,"date":"2012-04-18T23:45:31","date_gmt":"2012-04-18T13:45:31","guid":{"rendered":"http:\/\/ntsblog.homedev.com.au\/?p=740"},"modified":"2012-04-18T23:45:31","modified_gmt":"2012-04-18T13:45:31","slug":"windows-installer-uninstall-custom-actions-warning","status":"publish","type":"post","link":"https:\/\/ntsblog.homedev.com.au\/index.php\/2012\/04\/18\/windows-installer-uninstall-custom-actions-warning\/","title":{"rendered":"Windows Installer &#8211; Uninstall custom actions &#8211; WARNING!!!"},"content":{"rendered":"<div id=\"ntsbl-3088341609\" class=\"ntsbl-before-content ntsbl-entity-placement\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-6288941070289539\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:inline-block;width:728px;height:90px;\" \ndata-ad-client=\"ca-pub-6288941070289539\" \ndata-ad-slot=\"9356781486\"><\/ins> \n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div><p>With uninstall custom actions you have to be really careful.<\/p>\n<h2>#1 Rule<\/h2>\n<p>When working with uninstall custom actions, always encapsulate the custom action in a try \/ catch block!<\/p>\n<p>Why?<\/p>\n<p>If you are testing your uninstall process and it throws an exception you will be left with a half uninstalled application.<br \/>\nAs the application has not un-installed you cannot install a new version and as the uninstaller is compiled you cannot rebuild the installer to fix the error that is causing the exception.<\/p>\n<p>How do I know this?<\/p>\n<p>I did this exact thing. I was creating an installer that had custom actions for both install and uninstall.<br \/>\nI caused an exception in the uninstall process and I was left with a product that could not be uninstalled!<\/p>\n<h2>Can you recover from this?<\/h2>\n<p>I found that in this scneario the Microsoft Fix-it tool is your saviour.<\/p>\n<p>Download the fix it program from here, <a href=\"http:\/\/support.microsoft.com\/mats\/Program_Install_and_Uninstall\" target=\"_new\">Microsoft Fix-it Uninstaller<\/a><\/p>\n<p>Run the program and follow the prompts. <\/p>\n<p>I did a custom uninstall, chose my product that had failed to uninstall and it cleans up all the relevant registry keys so that it has been completely removed from the computer.<\/p>\n<p>Cheers<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With uninstall custom actions you have to be really careful. #1 Rule When working with uninstall custom actions, always encapsulate the custom action in a [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-740","post","type-post","status-publish","format-standard","hentry","category-c"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/posts\/740","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/comments?post=740"}],"version-history":[{"count":0,"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/posts\/740\/revisions"}],"wp:attachment":[{"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/media?parent=740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/categories?post=740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/tags?post=740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}