Jump to content

This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.

Uninstall app as Admin fails to remove registry

1 reply to this topic


  • Members
  • 1 posts

Posted 22 September 2007 - 01:48

My scenario:

- I install an app as Admin that contains registry keys to be written in the HKCU key.
- Then I run the app as User which causes the app to self-repair to write the HKCU registry data for User
- I then uninstall the app as Admin

The problem is that the HKCU entries for User remain upon uninstall of the app - which is due to the uninstall only removing what is knows about, right?

How can I ensure all HKCU registry entries for the User are removed when Admin uninstalls the app?

From my research it seems that I should be able to accomplish this with either the RemoveRegistry or Registry tables by specifiying the full path to the keys I need to delete. However as the uninstall is running as Admin it seems I would need to specify the removal of the User keys from HKEY_USERS but how I would not know the correct path for the key? Enumerate the entire structure? Must I create a custom action?

Thanks in advance.


  • Moderators
  • 1,447 posts

Posted 22 September 2007 - 08:13

This is a very common query. The overall idea from Microsoft seems to be that HKCU entries and userprofile files is to be considered "user data" and hence should not be removed. For example there could be licensing information in the registry that the user would like to keep even though the application is being uninstalled.

There are ways around this. I normally use Microsoft's ActiveSetup feature to register a batch file on uninstall of the main application. This batch file will then run once per user and clean out HKCU for all users. Read more about ActiveSetup here: http://www.etlengine...activesetup.txt

Note!: If you register an uninstall cleanup script to run once per user, and the user installs the app again, your install should disble the cleanup script from running.
-Stein Åsmul