Archive: How do Find out if SQL Express is already Installed?


How do Find out if SQL Express is already Installed?
I'm a newbie trying to create an installer that installs SQL Server 2005 Express. I would like it to test to see if Express is already installed. Right now I'm doing this:

ReadRegStr $R1 HKLM "Software\Microsoft\Microsoft SQL Server\SQLEXPRESS\CurrentVersion" "CurrentVersion"
IfErrors NotFound Found

NotFound:
GoTo Install

Found:
GoTo Complete

This works fine on my machine, but I've tested it on another machine and it did not work. Any Ideas???


Hi,
perhaps on the other machine the key is registered at:

ReadRegStr $R1 HKCU "Software\Microsoft\Microsoft SQL Server\SQLEXPRESS\CurrentVersion" "CurrentVersion"

Note the HKCU (HK_CurrentUser), when the software was installed only for one person? Try out.


Thank you for the reply phisuio!

I looked on my machine and there was not an entry for "SQLEXPRESS" on HKCU...BUT I found a way to check for SQL Express.

This seems to work if anyone is interested. It may not be the best way, but with a two day deadline I will use anything that will work.

ReadRegStr $R1 "SOFTWARE\Microsoft\Microsoft SQL Swerver\Instance Names\SQL" "SQLEXPRESS"
IfErrors NotFound Found
NotFound
GoTo Install
Found
GoTo Complete

If anyone knows a better way please let me know!