tommyh1122
Posts: 16
Joined: Thu Jun 02, 2011 10:03 pm

Feature-based not running sql script

Hello,

I have a project that allows during installation a choice between installing Full SQL Server or just the Tools. This works fine but if Full SQL Server is selected a SQL Scripts should run and this is where I am having the problem. Here is what I have:

Under Prerequisites -> Feature-based I have created FeatureA and FeatureB.
A new Dialog page has been setup with a RadioButtonGroup called RADIO and two radio buttons (Full, Tools).
Under SQL Scripts I have added the script condition ?CFEB55_E155_4C34_ACDD_F2302CF52CB1=3 with the CFEB55_E155_4C34_ACDD_F2302CF52CB1 being the the component property of FeatureA in the Organization page.

The installation of Full SQL Server or SQL Server tools is working properly but running the SQL Scripts based on a Feature is not working correctly.


My FeatureAction.vbs file is:

' Set constants for the INSTALLSTATE_ABSENT and INSTALLSTATE_LOCAL feature states
Const msiInstallStateAbsent = 2
Const msiInstallStateLocal = 3

' Initialize the install states of the mutually exclusive features
' and set their states based on the radio button selection
Session.FeatureRequestState("FeatureA") = msiInstallStateAbsent
Session.FeatureRequestState("FeatureB") = msiInstallStateAbsent

If Session.Property("RADIO") = "Full" Then
Session.FeatureRequestState("FeatureA") = msiInstallStateLocal
ElseIf Session.Property("RADIO") = "Tools" Then
Session.FeatureRequestState("FeatureB") = msiInstallStateLocal
End If

Thank you
Michael
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Feature-based not running sql script

Hi Michael,

Please keep in mind that starting with version 9.3 and 9.4 we have a new related functionality you can use. It excludes using a .VBS so it's worth implementing.
Basically it revolves around the new Update Features Install States predefined custom action, but you can read more in the updated How do I show a custom feature selection dialog? user guide article.

Regarding the SQL script, why don't you condition its execution depending on the radio group selection rather then on the feature installation. If there's a good reason you've chosen the latter, you can also try the following condition instead:

Code: Select all

&CFEB55_E155_4C34_ACDD_F2302CF52CB1=3
All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”