Removing registry values
When it comes to uninstalling your product, you don't need to worry too much about the registry keys you've created. Windows Installer will make sure that all components, including registry keys, are cleaned up. However, in case you want to remove items from the registry that you didn't create—perhaps they were created by one of your other products—WiX provides a way to do it.
Two elements are used to remove data from the registry: RemoveRegistryKey
and RemoveRegistryValue
. We'll cover both in the following sections.
Remove all keys recursively
You'll use the RemoveRegistryKey
element when you want to remove a key from the registry and all of its sub keys. It must be placed inside a Component
element, as in this example:
<ComponentGroup Id="RegistryComponents" Directory="INSTALLLOCATION"> <Component Id="CMP_RemoveRegistryKey" Guid="3B0C6FD9-D73A-4CE9-8053-BBBB2BE8716B" KeyPath="yes"> <RemoveRegistryKey...