How to get SQL Server Instance names if more than one? - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

ntodorov
Posts: 7
Joined: Tue Aug 07, 2007 3:41 pm

How to get SQL Server Instance names if more than one?

How to get SQL Server Instance names if more than one?

I need to execute some sql with osql.exe for selected by user instance names of SQL Server. I know about registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\InstalledInstances – but it is multi string. And I want to list all values from this key in Check List box. Is it possible?
How to obtain multi string value from registry and how to put it in check list box or in component where client can select some instance names or all of them?
How to run Custom Action for more than one time? Action must be run according customer selection.

Nik
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,
I need to execute some sql with osql.exe for selected by user instance names of SQL Server.
Note that Advanced Installer offers support to run SQL scripts please see:
http://www.advancedinstaller.com/user-guide/sql.html
And I want to list all values from this key in Check List box. Is it possible? How to obtain multi string value from registry and how to put it in check list box or in component where client can select some instance names or all of them?
Take a look here for a similar approach:
http://www.advancedinstaller.com/forums ... php?t=1768
How to run Custom Action for more than one time? Action must be run according customer selection.
This can be done by using a control event (published events). Create a custom action under "UI Custom Actions" and use it as "DoAction" control event in "Dialogs" page:
http://www.advancedinstaller.com/user-g ... rol-events

Regards,
Gigi
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com/
ntodorov
Posts: 7
Joined: Tue Aug 07, 2007 3:41 pm

Note that Advanced Installer offers support to run SQL scripts
Yes know, but the problem is that AI uses only ODBC for executing sql scripts and with ODBC there are lot of "small" problems with sql server – “RESTORE DATABASE” problem,” timeout expired” problems and etc. If AI gives me option to use ADO instead of ODBC I will become a fan of AIs' SQL scripts ;)
This can be done by using a control event (published events). Create a custom action under "UI Custom Actions" and use it as "DoAction" control event in "Dialogs" page
Does it mean that upon user selection the custom action will be executed? If yes this isn’t appropriate because user may select wrong instance name by mistake.
Better approach will be executing osql by VB script within cycle I think.
Thanks for advices! VB script for multistring registry values was very useful.

Nik

Return to “Common Problems”