Unable to uninstall Visual Studio 2008, could not open Components key

I've been through this error a lot of times, sigh...

Why does it happen?

Incorrect removal of software or parts of software can cause this problem,
in my case Microsoft Install Clean-Up Utility caused these problems...

This causes permissions of sub keys of Components to be set wrong.

Where does this happen in the registry?

HKEY_LOCAL_MACHINE
--> SOFTWARE
--> Microsoft
--> Windows
--> CurrentVersion
--> Installer
--> UserData
--> S-1-5-18
--> Components

How to fix this automatically?

http://support.microsoft.com/kb/313222

This might or might not work, try and see if it works in your case.

Another automatic attempt you could try is:

SubInAcl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f
SubInAcl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f
SubInAcl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f
SubInAcl /subdirectories %SystemDrive% /grant=administrators=f /grant=system=f

You will need to obtain SubInAcl for that.

If one of these solutions worked for you, praise yourself lucky...

If not, sigh...

How to fix this manually?

The annoying thing to fix this manually is that permissions are not applied recursive in that folder, whatever you try to do you will need to apply the permission changes more than once in order for the permissions to propagate properly.

You can try to do it but it did never work in my case...

  • Change the owner first, make sure the recursive thing is checked, apply, close it.
  • Then change the permissions, make sure the recursive thing is checked, read, apply, close it.

Process Monitor can help to indicate you what sub keys are still having problems, in this way you don't have to check the log over and over again to see where it still goes wrong. Just reset the filter and then make sure you filter every status except for ACCESS DENIED.

Clear the log and try again. For each key within Components that has permission problems, you will need to adjust the permissions as I described in the bulleted list so that they match the permissions of the Components key. You should then be able to click inside the key and it subkeys, if not, fix the permisiions for the subkeys too.

You will have to repeat this till it's fixed. Yes, it's annoying... :-(