I have SQL Server installed.
In the registry, the MSSQLServer key in * HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft * looks like this:

All of the following lines of code return values from the registry:
var mainKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE").OpenSubKey("Microsoft").OpenSubKey("MSSQLServer");
var subKey1 = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE").OpenSubKey("Microsoft").OpenSubKey("MSSQLServer").OpenSubKey("Client");
var subKey2 = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE").OpenSubKey("Microsoft").OpenSubKey("MSSQLServer").OpenSubKey("MSSQLServer").OpenSubKey("CurrentVersion");
However, this does not happen:
var subKey3 = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE").OpenSubKey("Microsoft").OpenSubKey("MSSQLServer").OpenSubKey("Setup");
The “settings” look the same as the other keys. Any thoughts why this command returns null?
source
share