cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Datagaard
Level 2

SQL Server Instance determination

I have been looking for a couple of days in the forums for a possible answer to my particular dilema without much luck.

Using InstallShield 2010 Professional: InstallShield MSI package

I am trying to ascertain whether during the installation process a user has selected an Express edition of SQL 2008 or a professional edition of SQL 2008 on either a local OR remote server.

Based on the SQL edition selected by the user, I wish to run an appropriate, separate SQL database creation script.

Thanks in advance. 🙂
Labels (1)
0 Kudos
2 Replies
Install_guy
Level 4

Hi Datagaard

Your SQL Version: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90\Tools\ClientSetup\CurrentVersion

Your SQL Instance name: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names

Also, you can run this T-SQL query to check versions and editions:
SELECT SERVERPROPERTY('productversion') AS N'Product Version',
SERVERPROPERTY ('productlevel') AS N'Product level',
SERVERPROPERTY ('edition') AS N'Edition'

=========== Installscript ===========================

Use RegDBGetKeyValueEx to query the respective keys mentioned above:
e.g.
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
// 80 = sql2000, 90 = sql2005 & 100 = sql2008
if (RegDBGetKeyValueEx("Software\\Microsoft\\Microsoft SQL Server\\80\\Tools\\ClientSetup\\CurrentVersion", "CurrentVersion", nvType, svMSDEVersion, nvSize)= 0 ) then
if (RegDBGetKeyValueEx("Software\\Microsoft\\Microsoft SQL Server\\80\\Tools\\ClientSetup", "SQLPath", nvType, svMSDEDataPath, nvSize)= 0 ) then
// Your code here

endif;
endif;
0 Kudos
Datagaard
Level 2

Thanks,

I'll give it a go.

😄
0 Kudos