View Full Version : How to uninstall folders

12-01-2005, 03:13 PM
When I install my application I install certain folders. When the application runs, new folders are created in the installed folders. When I go to uninstall my application the folders installed folders and their sub folders are not removed. I think they are refered to as "orphaned" folders, correct me if I am wrong.

How can I get these folders and subfolders removed during the uninstall? :)

12-01-2005, 08:17 PM
Since Express Edition does not expose MSI tables, you are left with creating your custom action which, at uninstallation, will remove folders created by your application.

12-02-2005, 07:48 AM
Ok, are ther any examples or psuedo scripts that show how to do this?

12-04-2005, 11:42 PM
A quick search on remove folder found this thread (http://community.macrovision.com/showthread.php?t=119111&highlight=remove+folder).

12-05-2005, 04:40 PM
Hey thanks. :)

Now since I am new to this, when during the uninstall should custom actions of this sort take place? When I look at the Custom actions screen for uninstallation I see 8 diffrent choices. Is it critcal to have in a certian place vs. other places?

12-05-2005, 06:08 PM
I would have scheduled it as a commit custom action. Express does not expose all options available to custom action, so I am not entirely sure if it's possible to do exactly that.

I don't quite know where exactly in sequences the available options correspond to, and I no longer own a copy of Express 11. To find out that, you will have to build your .msi and examine it with Orca.

Where your custom action is scheduled could be important. If it is scheduled in UI Sequence, it will not get executed when running in silent mode. If it is scheduled in Immediate Execute Sequence, you won't be able to schedule rollback custom actions there. If it is scheduled in Deferred Execute Sequence, you can insert a rollback custom action to undo your custom action (may not quite apply in this case though), but you will have to do extra work if you want to use most of properties in your deferred custom action.

There are many options to custom action, I will strongly recommend reading up on and familiarizing yourself with them. For complete documentation on Custom Actions, you will want to refer to this link (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/custom_actions.asp).