cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
honolua
Level 7

Custom InstallScript Action During Uninstall?

Project Type: InstallScript MSI

I've been trying figure out how to create an InstallScript custom action to run during uninstallation but have yet to succeed. We need to run some external apps to unregister services and perform other cleanup. Actually, it would be best if this could happen during maintenance and upgrades as well. I've tried to detect the uninstall at the InstallScript level to no avail. Sometimes my conditions were true during first install despite the property being named REMOVE. I've also tried sequencing a custom InstallScript action with the Installed condition. My custom action does not get executed, as near as I can tell.

So my question is, what exactly needs to be done to execute an external app during the uninstall sequence for an InstallScript MSI project? The external apps we need to run are installed with the software so the action needs to happen before the installed files are removed.
Labels (1)
0 Kudos
(1) Reply
peterbi
Level 7

If your project type is InstallScript MSI (not Basic MSI), you should be able to use event handlers like OnMaintUIBefore() or OnMaintUIAfter() inside which check maintenance type and proceed. Following is basic prototype:

OnMaintUIBefore()
...

nType = SdWelcomeMaint(...);

switch (nType)
case MODIFY:
...
case REPAIR:
...
case REMOVEALL:
...
default:
(error out)
end;



HTH,
Peter
0 Kudos