Вопрос

When uninstalling my application, I'd like to configure the WiX setup to remove all the files that were added to %appdata% folder, after the original installation.

But here is the problem, my application can be run for many users. In the application start I have a function that creates the files if they do not exist. So I want to remove all files, no matter what "user/appdata" they are.

A similar question has already been asked here: Removing files when uninstalling WiX

But the difference is the handling for multiple users.

Это было полезно?

Решение

Synopsis: Don't do it that way; Leave it to each user but make it easy to understand and do.

Scenario:

  1. A user installs a version of your application.
  2. Zero or more users run it, and the application creates data for them individually.
  3. A user uninstalls your application.

Variations:

  • Instead of uninstalling, a user upgrades to a newer version.
  • Instead of uninstalling, a user downgrades to an older version.
  • Some time after a user uninstalls your application, a user installs a newer version.
  • Some time after a user uninstalls your application, a user installs an older version.
  • Some time after a user uninstalls your application, a user installs the same version.

Considerations:

  • Would users be aware of the data and consider it their own work?
  • Would users care if the data was wiped out and recreated? (That would be the effect of some other user uninstalling the application with the data being deleted and then some user re-installing it.)
  • Can the application detect the version of the data?
  • Can the installer detect the version of the data?

Possible solution:

Let each user decide at any time to "uninstall" the data. (This solution addresses only some of the issues raised above.)

  • The application creates an "uninstaller" for each user that runs the application.
  • The user data uninstaller is registered by the application under the user's profile in "Add/Remove Programs" and/or as a shortcut in the user's Programs menu.
  • The application installer doesn't have anything to do with the data.
  • The user data uninstaller could be a simple script/program but does need to unregistered and delete itself, too. One way to do it is as a Windows Installer package silently installed (per-user) by the application.
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top