At times in an InstallScript or InstallScript MSI project, you want to be sure everything is removed on an Uninstall, and I mean everything. Every last drop of stuff you’ve installed on the user’s computer.
To remove features during an Uninstallation, you have several choices:
- FeatureRemoveAll() – forces the removal of all features that were installed previously.
- FeatureRemoveAllInLogOnly() – forces the removal of all features that are not in the current media, but were installed previously, as recorded in the setup log file.
- FeatureRemoveAllInMedia() – forces the removal of all features that are in the current media and were installed previously.
- FeatureRemoveAllInMediaAndLog() – forces the removal of all features that were installed previously, both those that are in the current media, and those that are not in the current media but are recorded in the setup log file.
When you want to remove everything, the best bet is to use FeatureRemoveAllInMediaAndLog().
Now, does this mean you can just rely on the function and not test thoroughly? No. You still have to test the uninstallation thoroughly. Things happen. You may have missed something. It happens to all of us and is nothing to be ashamed about. Testing is the final word.
What about when you are given an existing installation you didn’t create, you’re told the uninstallation doesn’t work properly, and told you have to fix it? In that situation you have to be a detective and go through the project and find the mistakes. It can take a while and can be very frustrating, but that’s the only way to solve the problem. Okay, you could start over, but that is not always an option. Especially on huge installations that would take a very long time to recreate.
I’m going to go out on a limb here and say that you should never have any problems with an uninstall. That is IF you have set up your InstallShield project correctly. That’s been my experience.