Error 1402. Could not open key: UNKNOWN\Components\…

Recently, I was developing a setup package whose uninstall actions were broken. During testing, I could install the package but wasn’t able to uninstall it. To remove the package and go on with development, I used the Windows Installer Cleanup Utility. So far, so good – I thought.

Next time I tried to install the package, I got the error “Error 1402. Could not open key: UNKNOWN\Components\[Big number]\[Big number]”. What happened? A look into the Registry Editor revealed two secrets:

  1. The specified key was underneath HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components
  2. Apparently, the Cleanup Utility didn’t remove all the registry entries of my former setup very correctly. Instead, it left the mentioned key in the registry but removed or messed up my permissions:
    s1

What do? Right-click, then Permissions shows following screen:
s2
Also, the key had no owner:
s3

So the fix was clear: set the owner and add permissions:
s4

And voila: you can access the key again!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s