PDA

View Full Version : Find installed SQL server(s) from Registry system Search



Amarjeet
09-19-2016, 06:00 AM
Hi

I am trying to search installed SQL server on my machine. Information about installed instances is stored at below registry key. I would like to detect any instance with any name.


11192


As the instance name can be of any text string I find it very difficult to search by exact string name.

Going through install shield documentation I have found that there is no Wild Card search available in system search.

Is there any way I can find out installed SQL servers on machine ?

Thanks in advance.

Amarjeet

rguggisberg
09-19-2016, 01:53 PM
Do you need to know if the SQL instance is running... or don't you care?
Do you want to output this list to the screen or to a text file?

I have attached a bat file renamed to SQLInstances.txt. Download that and rename it to SQLInstances.bat.
It will list 32 & 64 bit instances and tell you whether or not they are running. Output goes to display and to log file.
Could be simplified if you don't care if they are running or if you don't need the log file.
I use this in a Suite project. You could use it in a custom action to populate a list if you prefer.

Amarjeet
09-20-2016, 04:02 AM
Hi Rguggisberg,

My requirement is - If any SQL server is installed on the machine I don't want to install new SQL server from my package. Its running OR NOT running does not matter.

I am happy to implement any mechanism which can provide me list of SQL servers installed. Even numbers will do.

Regards,

Amarjeet

hidenori
09-20-2016, 07:28 AM
You may simply want to check for the existence of the Instance Names registry key under HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server. The registry key does not exist if no instances of SQL Servers are installed.

Amarjeet
09-22-2016, 06:00 AM
Hi Hidenori,

Thanks for your solution. It worked like a charm.

Amarjeet