My task is to save registry keys on uninstalling our product depending on condition.
For example, if the user will enable a special checkbox “Don’t delete my settings”, the registry keys must to stay on. I know that the component element in wix has the special attribute “Permanent”, but my installer must to delete all installed components on uninstall by default. Any ideas? How to do this in wix? Or I have to use a custom action?
Thank’s for your time.
My task is to save registry keys on uninstalling our product depending on condition.
Share
The correct approach is backwards.
These registry keys should always remain on the target machine. This can be done by marking their components as Permanent as you mentioned or by setting an empty GUID for them.
After that, on one of your uninstall dialogs you can add a “Delete settings” checkbox. This checkbox can then condition an uninstall custom action which deletes the registry entries.