Friday, March 23, 2012

How to determine if SQL 7 SP4 or higher is installed using Registry

I am developing an .msi package that requires SQL 7 SP4 or higher to be installed. I would like to use the registry to confirm a valid SQL installation and from there I can determine if my .msi installation should continue as normal or display an error m
essage asking to install SQL first.
I couldn't find much solid information on the web. This is all I have:
All versions:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\MSSQLServer
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer
6.0 and above:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Servic es\MSDTC
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\SQLExecutive
7.0 and above:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\SQLServerAgent
HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server 7
HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServ65
However, what key and value should I use to look for the specific SQL version? Does this value hold a simple number like '7' and for any more recent versions of SQL would this number be higher in value? Such as '2000' for a SQL 2000 unit?
Thanks for your time
HKEY_LOCAL_MACHINE/Software/Microsoft/MSSQLServer/MSSQLServer/CurrentVersion
/CSDVersion
Rohtash Kapoor
http://www.sqlmantra.com
"k8e" <anonymous@.discussions.microsoft.com> wrote in message
news:0E857F02-C889-4951-BC38-1ADFB361B9EA@.microsoft.com...
> I am developing an .msi package that requires SQL 7 SP4 or higher to be
installed. I would like to use the registry to confirm a valid SQL
installation and from there I can determine if my .msi installation should
continue as normal or display an error message asking to install SQL first.
> --
> I couldn't find much solid information on the web. This is all I have:
> All versions:
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\MSSQLServer
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer
> 6.0 and above:
> HKEY_LOCAL_MACHINE\System\CurrentControlSet\Servic es\MSDTC
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\SQLExecutive
> 7.0 and above:
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\SQLServerAgent
> HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server 7
> HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServ65
> --
> However, what key and value should I use to look for the specific SQL
version? Does this value hold a simple number like '7' and for any more
recent versions of SQL would this number be higher in value? Such as '2000'
for a SQL 2000 unit?
> Thanks for your time

No comments:

Post a Comment