How to Detect SQL Server 2005 and SQL Express from NSIS
From my NSIS installer I'll restore a database of SQL Server 2005. But prior to this act I want to confirm whether the user's system is having SQL Server 2005 or SQL Server 2005 Express Edition (SSE). Please note that I don't need instance names etc. info., just want to know whether SQL 2005 or SSE is there or not.
Please keep in mind that, the user may have other versions of SQL Server installed in his system like MSDE, SQL 2000.
For MSDE/MSSQL I use:
ReadRegStr $R0 HKLM \
For my this issue, I'm trying with the following but someone informed me that it didn't detected his sql express.
Please give better and correct solution then this:
;for sql server 2005
ReadRegStr $R1 HKLM \
"SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL" MSSQLSERVER
;for sql express:
ReadRegStr $R2 HKLM \
"SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL" SQLEXPRESS
ps:As usual its need quick response as my installer is just waiting for this check to be bundled in it.