How to workaround errors installing .NET Framework 2.0 that are caused by registry permission problems

I have had a few customers report problems installing the .NET Framework 2.0 with the following symptoms:

  • .NET Framework 2.0 setup fails and rolls back with no specific error message, just a generic "setup failed" message at the end
  • The action that fails is "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\regtlibv12.exe" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\mscoree.tlb" or "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\regtlibv12.exe" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\mscorlib.tlb" (you can find the error by using the steps described here)
  • The error code listed in the log file %temp%\dd_netfx20msi*.txt is 8002801c

Examples of this problem are the comments located here and here, and the Product Feedback Center bugs located here and here and here.

The underlying problem is that the Administrators group somehow was only granted read permission to some of the registry keys under HKEY_CLASSES_ROOT on these machines. When the .NET Framework setup tries to register type libraries, it needs to create some new values under HKCR and it fails because of a lack of permissions (8002801c means "error accessing the OLE registry"). I have been able to confirm that this is the problem by having one of the customers use RegMon, but I haven't been able to figure out how the permissions got modified to be this way. Up until now I also haven't been able to figure out how to fully reset the permissions so that .NET Framework setup will work.

Fortunately one of the customers who had this problem contacted us with a solution that worked for them, and I wanted to list it here in case others run into this same problem in the future. Here are the steps to follow to repair permissions to workaround this issue:

  1. Download the SubInACL tool from this Microsoft site and install it. By default it will install to c:\Program Files\Windows Resource Kits\Tools
  2. Go to the Start menu, choose Run and type cmd
  3. Type cd /d %ProgramFiles%\Windows Resource Kits\Tools to change directories to the folder that SubInACL is installed to
  4. Type notepad reset.cmd and press yes to create a new file named reset.cmd in c:\Program Files\Windows Resource Kits\Tools
  5. Copy and paste the following contents into reset.cmd and then save and close it (or download it from here and rename it from reset.cmd.txt to reset.cmd):
    subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f
    subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f
    subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f
    subinacl /subdirectories %SystemDrive% /grant=administrators=f
    subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=system=f
    subinacl /subkeyreg HKEY_CURRENT_USER /grant=system=f
    subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=system=f
    subinacl /subdirectories %SystemDrive% /grant=system=f
  6. Type reset.cmd and press enter to run the SubInACL tool (you will need to have adminstrator privileges for this to run correctly). This tool will take several minutes to run
  7. After reset.cmd completes, try to install the .NET Framework 2.0 or VS 2005 again

Hopefully this will help. If you try this and still have trouble getting setup to work correctly for the .NET Framework 2.0 or VS 2005, please contact me.