litu
Posts: 71
Joined: Fri Mar 22, 2013 2:57 pm

Show an alert to old SQL

Hello,

We have some customers who still use SQL Server 2005 and we want the installer shows an alert with a message like "Your SQL version is old, it'll be good to update it; but we're good people and the install can continue" and an "ok" button to move on and continue the installation.

Is that possible?
If not an alert, maybe a dialog based on the SQL server condition?

Thanks in advance,
Arnau.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Show an alert to old SQL

Hi Arnau,

In order to achieve this, you can create a search to see if no newer version than the "SQL Server 2005" software is installed on the machine, then add a "Display message box" custom action that will be displayed based on that search.

For example, if the following registry value is equal with the "9.00.1399.00" value, the "SQL Server 2005" software is installed on the machine:

Code: Select all

HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\90\Tools\ClientSetup\CurrentVersion\CurrentVersion
Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
litu
Posts: 71
Joined: Fri Mar 22, 2013 2:57 pm

Re: Show an alert to old SQL

Hi Eusebiu,

Thanks a lot.

I think that will work. My scenario is a little more complicated than looking at the registry because some clients have two servers for our application (one for IIS and the other one for the SQL) and the install is launched from the IIS.

I guess I'll have to launch an SQL query after the user enters the credentials in the dialog box.

Thanks again,
Arnau.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Show an alert to old SQL

Hi Arnau,

If you want to search for those registry entries at a specific point of the installation, you can create a custom action with this functionality and place it at the appropriate position in the "Custom Actions" page.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
litu
Posts: 71
Joined: Fri Mar 22, 2013 2:57 pm

Re: Show an alert to old SQL

Hi Eusebiu,

Registry entry doesn't work in my scenario.
If the client has two or more instances and our databases are in a "modern" SQL version, it could show the message box to the wrong people.

I need to ask for the SQL credentials (which I already do) and launch a query. What i don't know is how I can set a property from the query.

Will this work?

Code: Select all

SELECT @@version AS MY_PROP
It's my guess.


Thanks for your patience,
Arnau.
litu
Posts: 71
Joined: Fri Mar 22, 2013 2:57 pm

Re: Show an alert to old SQL

Hi,

I have on the same dialog (the one that asks for the server and the credentials for the SQL server) two custom actions: one that queries the database for its version and the one that shows the dialog if the SQL is 2005.

But the dialog is never shown. My best guess is that the show dialog never gets the updated property from the query.

The query I wrote is:

Code: Select all

declare @VERSIONSQL as bit
set @VERSIONSQL = 0
if (@@version like '%SQL Server 2005%')
begin
	set @VERSIONSQL = 1
end
Any idea?

Thanks in advance,
Arnau.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Show an alert to old SQL

Hi Arnau,

In order to set a property from an SQL Query, you can add a property in the "Data Binding" section, then create a select as below:

Code: Select all

SELECT @version from 'tableName'
The @version value will be automatically placed in the property from the "Data Binding" section.
But the dialog is never shown. My best guess is that the show dialog never gets the updated property from the query.
I'm not sure why the dialog is not displayed. Can you please send us the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com, so we can investigate them?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
litu
Posts: 71
Joined: Fri Mar 22, 2013 2:57 pm

Re: Show an alert to old SQL

Hi Eusebiu,

As you said, the SQL script must be a SELECT statement. So, my second approach didn't work.

My first approach works.

Code: Select all

 SELECT @@version AS MY_PROP
But I have to compare MY_PROP as a string MY_PROP << "Microsoft SQL Server 2005"


Thanks for your patience,
Arnau.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Show an alert to old SQL

Hi Arnau,

If the SQL version is stored in the "MY_PROP" property, you can add a "Display message box" custom action that will be displayed based on this property (i.e. MY_PROP = "Microsoft SQL Server 2005").

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”