Hello Robson,
In order to implement this scenario you can proceed like this:
- go to "Dialogs" page and on your customization dialog add three check box controls like this:
- Text: Prerequisite
Value: checked
Property Name: PREQ
Text: SQL Script
Value: checked
Property Name: SCRIPT
Text: Application
Value: checked
Property Name: APP
- go to "Prerequisites" page and add the SQL Server package as a
feature-based prerequisite
- go to "Organization" page, select the feature of the added prerequisite and from the
"Feature Properties" right pane enable the "Install based on condition" option with the following condition:
- select the feature of your application and from the "Feature Properties" right pane enable the "Install based on condition" option with the following condition:
- go to "SQL Scripts" page and add the following condition for your SQL Connection:
- go to "Custom Actions" page and add a "Test ODBC Connection" custom action without sequence
- go to "Dialogs" page and on your customization dialog select the SCRIPT checkbox and add the following published events:
- Control Event: Set installer property value
Property: [SqlConnectionString]
Argument: Driver=[\{]SQL Server[\}];Server=[SERVER_PROP];Port=[PORT_PROP];Uid=[USERNAME_PROP];Pwd=[PASSWORD_PROP];
Condition: SCRIPT
Control Event: Execute custom action
Argument: TestODBCConnection
Condition: NOT (SqlConnectionString = "") AND SCRIPT
Control Event: Set installer property value
Property: [PREQ]
Argument: {}
Condition: (SqlConnectionOK = "1" AND SCRIPT) OR (NOT SCRIPT)
Control Event: Set installer property value
Property: [PREQ]
Argument: checked
Condition: SqlConnectionOK <> "1" AND SCRIPT
- build and run your project
Let us know if this helped.
All the best,
Daniel
FOLLOW US
Get the latest news in Application Packaging