vishal
vishal

Reputation: 616

How to remove registry keys on uninstall msi using WIX

I need to remove registry keys when user uninstall application.

These registry keys are in HKEY_CURRENT_USER\SOFTWARE.

I am using WIX tool.

Please note that keys are not getting registered on install but after login based on action performed by user.

Thanks in advance

Upvotes: 0

Views: 2116

Answers (1)

Christopher Painter
Christopher Painter

Reputation: 55581

Windows Installer can only access the registry hive of the user it's running as. It's technically possible to write a custom action to enumerate the user profile list and load each ntuser.dat but this ultimately causes all sorts of problem. The short answer is it isn't practical. Besides, Microsoft standards state to leave user data behind on uninstall.

If you really want to do it, the best way I know is to use a custom action to write to the registry during uninstall (something MSI doesn't support). Have this registry value set up an ActiveSetup command to invoke reg.exe delete. Then when each user logs in next time the key will be deleted.

Upvotes: 3

Related Questions