This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- SQL Server Instance determination
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 19, 2011
08:47 PM
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. 🙂
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. 🙂
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 21, 2011
07:16 AM
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
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
endif;
endif;
// Your code here
endif;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 24, 2011
06:59 PM
Thanks,
I'll give it a go.
😄
I'll give it a go.
😄