Error 1606. Could not access network location %SystemDrive%\inetpub\wwwroot\ while installing on IIS7

installation, windows-server-2008

Solution

I encountered this error during an Infragistics 2007 installation. The solution was to modify the registry key value. The issue is with the installation program. The `%SystemDrive%` portion of the value should be replaced with `C:` For 32bit machines the key is

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\PathWWWRoot. 

For 64 bit machines the key that needs to be modified should be

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\InetStp\PathWWWRoot.

Found additional 64bit details here

Problem

I'm trying to port our software installer which currently supports Windows 2000 and Windows 2003 to a Windows 2008 environment. Currently, the installer gets an error which reads "Error 1606. Could not access network location %SystemDrive%\inetpub\wwwroot." %SystemDrive% is without a doubt C:\, and C:\inetpub\wwwroot\ has the correct accessibility. It is interesting that if I hardcode the path in the following keys in the registry to C:\inetpub\wwwroot\, without using the environment variable, the installer works correctly. • HKLM/Software/Wow6432Node/Microsoft/InetStp/PathWWWRoot • KHLM/Software/Microsoft/InetStp/PathWWWRoot. This seems like a very poor hack. I do not want to tell our clients that they need to hack their registry before they will be able to install our product. Another option is to change the registry behind the scenes, do our install, and revert the registry keys to their original values at the end of the install, but obviously I don't like this solution either. I find it hard to believe that Microsoft would have done this without reason, so there must be an alternate approach to get these installers to work without modifying the registry. Any tips appreciated.

Original source