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.
RemoveRegistryKey
You'll use the RemoveRegistryKey
element when you want to remove a key from the Registry and all of its subkeys. It must be placed inside a Component
element, as in this example:
<DirectoryRef Id="INSTALLLOCATION"> <Component Id="CMP_RemoveRegistryKey" Guid="3B0C6FD9-D73A-4CE9-8053-BBBB2BE8716B" KeyPath="yes"> <RemoveRegistryKey Id="MyRemoveRegistryKey" Root="HKLM" ...