Error 1402. Could not open key
I was trying to install Microsoft Platform SDK for Windows Server 2003 R2 Web Install on my Windows XP SP2 machine and received the message:
Error 1402. Could not open key: HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders. System error 5. Verify that you have sufficient access to that key, or contact your support personnel.
Most annoying was the fact that when I clicked OK to the error message, the installation rolled-back. No chance to even Retry?
My first thought was that this must be a permissions issue to I fired-up regedit and checked the permissions. My user had full control and read permissions to the Shell Folders key, so did the administrators group and SYSTEM. I gave Power Users, Users and Everyone Full Control too, but I was thinking at the time that this probably wouldn't help as, on the face of it, the original permissions were permissive enough.
I tried the Web Install again and was horrified to find that it seemed to be downloading the packages all over again. I went out to walk the dog.
I returned an hour later to the same poxy message. Permissions still not good enough.
I downloaded the FULL install package and tried the installation many more times with no success. I used ProcMon which confirmed that msiexec was not able to read the key:
Sequence: 1080206
Date & Time: 08/02/2008 20:46:36
Event Class: Registry
Operation: RegOpenKey
Result: ACCESS DENIED
Path: HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
TID: 3028
Duration: 0.0000186
Desired Access: Read
Eventually, I found the thing I'd been missing. SYSTEM permissions for the Shell Folders key were:
Read:Allow
Full Control:Allow
Special:Deny
and removing Deny from Special was all that was required!
Sequence: 2550649
Date & Time: 08/02/2008 21:12:10
Event Class: Registry
Operation: RegOpenKey
Result: SUCCESS
Path: HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
TID: 3320
Duration: 0.0000153
Desired Access: Read