Question

To configure an install assistent, I have to check if SQL Server 2012 SMO is already installed. I found some answers for older versions of SQL Server (e.g. here and here) with the solutions to check the registry key HKEY_CLASSES_ROOT\Microsoft.SqlServer.Management.Smo.Database but this doesn't work for me. This registry key doesn't exists at Windows Vista and Windows 7, I think there are changes with the version 2012 of the SQL Server.

Was it helpful?

Solution

If you're checking for an installed component, then the best bet is to check the uninstall registry key.

On my machine the key value for "Microsoft SQL Server 2012 Management Objects (x64)" is this:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{43A5C316-9521-49C3-B9B6-FCE5E1005DF0}

There may be a different key entry for the 32bit version if you need that, but this is the way I always did software install checks when I was an SCCM admin.

EDIT: As it seems that Microsoft change the uninstall key every version making it difficult to keep track of the installation this way, there is another key here which is probably a good one to check:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\SharedManagementObjects\CurrentVersion

You could check the value of this to see if it's greater than 11 and if not (or it doesn't exist) do your install.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top