scholzr
Posts: 9
Joined: Thu May 24, 2012 6:26 pm

Run SQL script only if SQL Server prerequisite was installed

I need to run an SQL script if and only if the SQL Server 2008 R2 prerequisite was run. Is there a way to do this? I know that I can condition the SQL script, but I don't know what to use to determine if the prerequisite was installed? I currently have the SQL Server 2008 R2 enabled as a feature-based prerequisite.
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Run SQL script only if SQL Server prerequisite was insta

Hello,

In order to achieve this you can create an extended search in "Search" page identical with the one that search if your prerequisite is installed or not from "Prerequisite" -> "Install Conditions" tab. The search name is a property and you can use it in the "Script Condition" field from "SQL Scripts" page.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
scholzr
Posts: 9
Joined: Thu May 24, 2012 6:26 pm

Re: Run SQL script only if SQL Server prerequisite was insta

I tried this method, but it did not seem to work.

I am using the presence of a registry key for the specific instance name of my server installation to determine whether the SQL server installer should run. This worked correctly for the pre-requisite installation, but when it came time to run the sql script, it did not work. Is the search run during install? if so, is there a way to force it to run prior to the feature based pre-requisite?
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Run SQL script only if SQL Server prerequisite was insta

Hello,

If your installation package is running with Full UI, then searches from "Search" page are performed during "Wizard Dialogs Stage" -> "Searches" -> "AppSearch" standard action. If your installation package is running in silent mode, then searches from "Search" page are performed during "Install Execution Stage" -> "Searches" -> "AppSearch" standard action.

Also, please keep in mind that only the value of a public property is passed on from the "Wizard Dialogs Stage" to the "Install Execution Stage". So, you should use a public property (i.e. MY_SEARCH) for the name of your search from "Search" page if your package installation is running with Full UI.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”