How do I show a custom feature selection dialog?Answer
This article explains how to select which features will be installed by using checkboxes and radio buttons. First, you need to create the features for your project in the Organization page. For example:
Use checkboxes to select which features will be installed
' Set contants for the INSTALLSTATE_ABSENT and INSTALLSTATE_LOCAL feature states
Const msiInstallStateAbsent = 2
Const msiInstallStateLocal = 3
' Set the install state of the feature with the identifier "Feature1"
If Session.Property("CHECK1") = "install" Then
Session.FeatureRequestState("Feature1") = msiInstallStateLocal
Else
Session.FeatureRequestState("Feature1") = msiInstallStateAbsent
End If
' Set the install state of the feature with the identifier "Feature2"
If Session.Property("CHECK2")="install" Then
Session.FeatureRequestState("Feature2") = msiInstallStateLocal
Else
Session.FeatureRequestState("Feature2") = msiInstallStateAbsent
End If
' Set the install state of the feature with the identifier "Feature3"
If Session.Property("CHECK3")="install" then
Session.FeatureRequestState("Feature3") = msiInstallStateLocal
Else
Session.FeatureRequestState("Feature3") = msiInstallStateAbsent
End If
DoAction SetFeatureStates AI_INSTALL The control event on the button will launch the VBScript custom action. This custom action will set the install action for the features in your project depending on the state of the checkboxes. Use radio buttons to select which features will be installed
' 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
Session.FeatureRequestState("FeatureC") = msiInstallStateAbsent
If Session.Property("RADIO") = "RadioFeatureA" Then
Session.FeatureRequestState("FeatureA") = msiInstallStateLocal
ElseIf Session.Property("RADIO") = "RadioFeatureB" Then
Session.FeatureRequestState("FeatureB") = msiInstallStateLocal
ElseIf Session.Property("RADIO") = "RadioFeatureC" Then
Session.FeatureRequestState("FeatureC") = msiInstallStateLocal
End If
The code you added to the VBScript file will set the install action of the features "Feature A", "Feature B" and "Feature C" based on the selected radio button. Download and unzip the sample project to better understand how to configure your own project. An Enterprise version of Advanced Installer (version 6.2 or greater) is required in order to build and run the project. However, you can use any Enterprise version of Advanced Installer greater than 4.0 to implement this functionality into your own project. | |
|
| Privacy Policy | Windows Installer | Search Engine Ranking | Link Analyzer | ||
| © 2002 - 2008 Caphyon Ltd. Trademarks belong to their respective owners. All rights reserved. | ||