views:

6

answers:

0

We have a Windows app that installs for all users in the Program Files folder, and writes registry keys in HKEY_LOCAL_MACHINE.

When a user runs the application, user configurable stuff is copied into %APPDATA%\MyCompany\MyProduct\Version\ and also written to the HKEY_CURRENT_USER registry hive. This happens for each user that installs and logs in.

When the application is uninstalled, it's easy to remove the stuff from Program Files, and it's easy to remove the configurable stuff from %APPDATA% for the currently logged in user. It's possible, but less easy to remove things from %APPDATA% for other users with accounts on the system. And it's very difficult to remove things from HKEY_CURRENT_USER for other users.

Is there an elegant way to handle cleaning up for multiple users at uninstall? Or is it just accepted practice to leave a mess on Windows after uninstall?

Solution must work on XP, Vista, and Windows 7.

Predicting some questions from others:

1) There are some things in %APPDATA% that we'll leave because the user worked hard to make them. But others we know are unchanged, and we want to remove them. This question isn't about the merits of keeping or deleting user data, it's about how to do it.

2) No, switching to installing the whole app per-user isn't feasible at this time.