Adding an option to remove application data on uninstall? - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

scrungus
Posts: 4
Joined: Fri Jun 06, 2008 3:08 am

Adding an option to remove application data on uninstall?

Hi folks. When our application is running, it writes various bits of data into the user's Application Data directory (a.k.a. %APPDATA%). We want to give people the option on uninstall to remove this data; however, it wouldn't be removed by default, because we want to support people reinstalling the app without losing this data.

So I'm envisioning some dialog during the uninstall process with a checkbox like:

[ ] Remove application data? Note that you should only do this if you will never re-install this application.

Obviously we'd wordsmith this a little, but you get the idea. I poked around in advanced installer and the forums, and couldn't figure out how to do this. Is there a way? Seems like a fairly common scenario...
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Adding an option to remove application data on uninstall?

Hi,

In order to remove these files you can use a custom action. You can find more information about this and a sample custom action in our Remove a file or a folder during installation how-to.

Also, in order to show a custom message box you can use a another custom action which sets a property. Our Uninstall another MSI package when your application is uninstalled how-to contains a custom action which does this for the prerequisites of an installation package. After this custom action runs, you can use the property it sets to condition the custom action which removes the files.

Let me know if you encounter any problems with this approach.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”