I'm trying to create an installation where the user is presented with 3 choices - website only install, server agent install, or standalone install. I simply made a few changes to the built-in SetupTypeDlg, changing the text as needed for the three buttons. The (formerly) Typical button has a published event for:
Event: FEATURE_WEB = 1
Argument: 1
Condition: AI_INSTALL (I couldn't get this to change)
The second button (formerly Custom Install) now has NewDialog set to VerifyReadyDlg, and sets [FEATURE_AGENT] in the same way as above.
I then tried this a couple ways without success. First, I set the 'Website' feature (in Organization tab) to install the feature if INSTALLLEVEL > 999, with a Conditional Install Level set to:
Condition: FEATURE_AGENT = 1
Level: 1000
This did not work. Next, after reading about issues using properties set from the UI that aren't read until after CostFinalize, I tried adding a custom action with VBScript. I tried it both with the action listed under Install and CostInitilize (which I presume is before CostFinalize). The VBScript is (with some MsgBoxes for debugging):
Code: Select all
Function SetInstallFeatures()
MsgBox "Script Version: 4"
Dim Feature_Web
Dim Feature_Agent
Feature_Web = Session.Property("FEATURE_WEB")
Feature_Agent = Session.Property("FEATURE_AGENT")
MsgBox "FEATURE_WEB: " & Feature_Web
MsgBox "FEATURE_AGENT: " & Feature_Agent
if Feature_Agent = 1 Then
msgBox "Installing Agent"
Session.FeatureRequestState("Agent") = 3 'Will be installed
Session.FeatureRequestState("Website") = 2 'Will not be installed
msgBox "Finished installing Agent"
Else
MsgBox "Installing Web"
Session.FeatureRequestState("Website") = 3 'Will be installed
Session.FeatureRequestState("Agent") = 2 'Will not be installed
msgBox "Finished installing Web"
End If
MsgBox "Done"
End FunctionSession.FeatureRequestState("Agent") = 3 'Will be installed
I even tried simply making the Conditional Level for the Feature to:
Condition: 1 = 1
Level: 1000
...and that didn't work either.
So...what am I doing wrong? What is the best way to do a conditional install based on user selection (I don't want to do the standard Typical/Custom/Complete with custom selections that way).
FOLLOW US
Get the latest news in Application Packaging