Search code examples
c#installationregistrysql-server-2008-express

Registry Permissions Fix for SQL Server 2008 Express Install


I have a distributed windows application (written in C#) that currently uses MSDE. The decision was made to upgrade the client database to SQL Server 2008 Express since we need to be able to support Windows 7 (and still support XP) in the next year.

Currently, I am using a batch file to run the installer (and using a Configuration.ini as well), but recently encountered the following error during the install.

"Could not fix registry key HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\MSSQLServer\SuperSocketNetLib\Lpc. System.UnauthorizedAccessException: Attempted to perform an unauthorized operation. at Microsoft.SqlServer.Configuration.FixSqlRegistryKey.Program.OpenKey(String keyName) at Microsoft.SqlServer.Configuration.FixSqlRegistryKey.Program.FixRegistryKey(String keyName) at Microsoft.SqlServer.Configuration.FixSqlRegistryKey.Program.FixRegistryKeyAndSubKeys(RegistryKey key)"

I understand the issue and how to fix in manually.

I need the application to modify this registry key ahead of time and add permissions for the Administrator group or set the key to inherit permissions from the parent. I am also open to other solutions to this SQL 2008 Express installation problem.

I have been researching how to modify the permissions of registry keys but I have been running into issues trying to get it to work correctly (and to understand all the classes and objects associated with setting permissions).

Can someone provide the proper way to add the Administrator group (of any machine) with full control permissions, or how to set the permissions of the key so that it inherits from the parent?

Side question, will their always be an Administrator group on every Windows XP machine?

Thanks!


Solution

  • So the solution was having a temp.txt file with the following in the file:

    \Registry\Machine\Software\Microsoft\MSSQLServer\MSSQLServer\SuperSocketNetLib\Lpc [1 5 8]
    

    Then run this in the cmd prompt (put your txt file in C:\temp or something):

    C:\temp>regini temp.txt
    

    I was really hoping to have any easy way to just change the inheritance permission, but this solution will work for my purposes and I will just include a batch file to be run before install SQL Server Express 2008.