Why Uninstallers Don’t Clean Up User Files

In my previous post, I described why installers don’t do per-user setup. Do the same issues apply at uninstall time?

Yes, only more so. First, as with installation, the user directories may not be accessible to the installer. This can happen, as I’ve mentioned before, when using Windows roaming profiles.

Even if you could access the user directories you may not get to run any code to do the cleanup, anyway. On Mac OS, for example, the preferred uninstall method is simply dragging the application to the trash. There is no uninstaller to do any work.

Finally, it isn’t always clear what you should clean up, anyway. Clearly user documents should not be removed. What about preferences? If the user is done with an application forever—and they’re not going to reinstall it—then delete the preferences might be reasonable. But what if the application is going to get reinstalled right away? Or re-installed in a week or a month? Should the user preferences persist across the uninstall/reinstall? It isn’t clear.

6 Responses to Why Uninstallers Don’t Clean Up User Files

  1. Kishor Ranga says:

    Is there any way in code to un-install outside AIR package using Flex/AS2/AS3 programing ?

  2. Oliver Goldman says:

    @Kishor: No, there’s no way to run application code at uninstall time. As I said in the post, there’s no way to guarantee any code is run during uninstall.

  3. dan says:

    Am I missing something?At a bare minimum, as part of the AIR application XML spec, there should be a flag to allow application distributors to blow away data from a previous install if they can’t kill it at uninstall.I can’t find any evidence of this type of functionality in searching on the forums…In your pursuit of simplicity, you could simply generate a GUID at install time that identifies that install instance. When each independent system user runs the app, you can compare the GUID with the one last used by that user. If they are different, the flag from the applicaion XML is checked, and the user data is wiped if specified, Simple. Does this exist and I’ve missed it somewhere?If it is an option, sweet, please point me in the right direction, if not, here’s a little rant:How simple is it for the screwed user to figure out how to get to %appdata% on windows, something only extreme power users even know exists, and remove some corrupted application settings file? Most windows user (IMO) konw that if an app isn’t working, you just uninstall and reinstall it… except with “simple” air applications apparently.I guess as an application developer you could check the last modified date on the application file itself… is this value always going to be the time that file was created at the last install time. I don’t know if this value is consistent across all platforms… Seems super hacky for what should be fairly simple.

  4. Jason Benson says:

    I couldn’t agree more with Dan. Beyond just the files in %appdata% there (at least to me) has has been the issue of the local sqlite database.The availability of the local sqlite database was for me a critical feature but then to find that when the application was uninstalled / reinstalled all of the old stuff remained as a real thorn in development.So now I’m forced to update a file with the version of the application to ensure that database schema is correct or write some comparison script and keep up with versioning that way.Maybe this behavior is a bug or an oversight on my part but the lack of deletion of application data in general can pose serious problems both to the developers and the end users.”But what if the application is going to get reinstalled right away? Or re-installed in a week or a month? Should the user preferences persist across the uninstall/reinstall? It isn’t clear.”Then Adobe is making a decision that isn’t theirs to make. There’s no way the installer can ever answer the question without user input. *Plenty* of uninstallers ask questions like “Would you like to save your application settings and files” or similar verbiage to overcome this.Maybe as the end user I want to uninstall twirhl and reinstall it immediately or maybe I’m uninstalling an application so I can “start over”.IMHO, Instead of giving them a survey about what things should be removed, remove the application, everything in %appdata% associated and clear the db.By the way though, I’m working on an Air project right now and it’s just so great that I’ll put up with almost anything on the managed installer side. Air, frankly, is just short of amazing.

  5. Carl Jones says:

    Here are my ‘untechnical’ observations. When we install our app, AIR provides what I will call a “local workspace” (I do not know the AIR term) in \ApplicationData.That workspace (folder) remains after an uninstall. Is there a way to tell AIR to remove the workspace when the uninstall is done?-carl[No, there’s not. Feature requests can be made at http://www.adobe.com/go/wish. —Oliver]

  6. Tom Esposito says:

    I just posted a “wish” from that link. This would be a great feature, but for now I’ll just code around it.Tom