Regarding Executing Custom Action After Uninstall - Advanced Installer Community
a.singh
Posts: 16
Joined: Wed Jan 11, 2017 10:38 am

Regarding Executing Custom Action After Uninstall

Hi,

I need to know is there any way by which I can execute a Custom Action after MSI Uninstall is finished. I need to run this custom action in deferred mode. Please let me know how to do this.

Many Thanks. :)
codesynergy
Posts: 100
Joined: Fri Nov 14, 2014 10:29 pm

Re: Regarding Executing Custom Action After Uninstall

Hello a.singh,

I guess it depends on what you mean by "after MSI uninstall is finished". Deferred custom actions can only be executed between InstallInitialize and InstallFinalize. So, you cannot run a deferred custom action after InstallFinalize - it must be immediate. If you just mean after the "main" part of the install has finished (the actions between InstallInitialize and InstallFinalize, you might check into "Commit" custom actions: https://msdn.microsoft.com/en-us/librar ... s.85).aspx


Not sure if that helps.
a.singh
Posts: 16
Joined: Wed Jan 11, 2017 10:38 am

Re: Regarding Executing Custom Action After Uninstall

Can you please tell me how to create Commit Custom Actions? It was not very clear from the link you have provided.

Thanks.
codesynergy
Posts: 100
Joined: Fri Nov 14, 2014 10:29 pm

Re: Regarding Executing Custom Action After Uninstall

The following links will help:
http://www.advancedinstaller.com/user-g ... -page.html
http://www.advancedinstaller.com/user-g ... -list.html

Essentially, go to "Custom Actions" on the left pane, select the type of custom action you want to run (Add Custom Action With Sequence). Move it between InstallInitialize and InstallFinalize, and change it to "After the system has been successfully modified (commit)."

But, again, it's important to understand if a "commit" custom action is what you really want. The following link has some additional info:
http://www.advancedinstaller.com/user-g ... tions.html
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Regarding Executing Custom Action After Uninstall

Hello,

Thank you @codesynergy for your contribution to Advanced Installer forum.

As @codesynergy said, "Deferred custom actions" are available only between InstallInitialize and InstallFinalize. Please note that, deferred custom actions do not have access to installer's public properties. You can read more about the deferred custom actions in the Deferred custom action article.
Can you please tell me how to create Commit Custom Actions?
In order to do that you should check the After the system has been successfully removed (Commit)" option from the custom actions properties, as you can see below:
custom action properties.png
custom action properties.png (8.8 KiB) Viewed 7032 times
You may need to enable the Run under the LocalSystem account with full privileges (no impersonation) option so that the custom action will be executed under the LocalSystem account with full privileges.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”