briefcase icon indicating copy to clipboard operation
briefcase copied to clipboard

MSI: Ability to customize uninstallation steps further

Open lrandersson opened this issue 1 month ago • 5 comments

What is the problem or limitation you are having?

  1. I have an installer that installs a product that writes to %USERPROFILE%\.foo\bar.txt. When the user uses the product, the file bar.txt can sometimes be updated. My issue is that when the user uninstalls the product, the contents of bar.txt need to be updated.
  2. There is also the case that when the user uses the product, files are created in the installation directory. Since these are created post-installation, the MSI uninstaller is not aware of this and will not remove those files. This results that the uninstaller leaves files behind.

Both of these problems are related to customizing the uninstallation, and according to WiX documentation it should be possible.

Describe the solution you'd like

  1. I believe the file updating described above could be resolved by allowing the user to specify a CustomAction, see: https://docs.firegiant.com/wix/schema/wxs/customaction/ I'm not sure if there is any better "best practice" or similar. Any input is appreciated.
  2. For removing additional files during uninstallation, it would be good if the user would be able to specify elements such as RemoveFolderEx where I can specify certain files/folders that require removal during the uninstallation process, to target files created post installation. https://docs.firegiant.com/wix/schema/util/removefolderex/

Describe alternatives you've considered

I've thought about solutions via pre_uninstall_script but this seems brittle. Happy to discuss this more in detail.

Additional context

No response

lrandersson avatar Nov 24 '25 19:11 lrandersson