Hello and welcome to Advanced Installer forums,
Thank you for your interest in Advanced Installer.
In order to achieve what you want you can use our
"ExtractComboBoxData" predefined custom action to extract all combo box items (extracted in "AI_COMBOBOX_DATA" property). Then, you can create your own custom action wich will parse the "AI_COMBOBOX_DATA" property content and will extract selected item text and value. Also, please keep in mind that a combo box property is always set with its selected item value.
Here are the steps to proceed:
- Go to "Dialogs" page and add your combo box control (e.g. COMBO_PROP).
- Go to "Custom Actions" page and add our "Extract combo box data" custom action without sequence.
- Add a "Launch attached file" custom action without sequence (e.g. ExtractSelectedItem) using a VBS file like this:
Code: Select all
Dim comboBox
Dim selectedItemValue, selectedItemText
comboBox = Session.Property("AI_COMBOBOX_DATA")
selectedItemValue = Session.Property("COMBO_PROP")
itemsArray = Split(comboBox, "|", -1)
For Each item In itemsArray
tempItem=Split(item,"#")
If (tempItem(0) = selectedItemValue) Then
selectedItemText = tempItem(1)
End if
Next
Session.Property("COMBO_VALUE") = selectedItemValue
Session.Property("COMBO_TEXT") = selectedItemText
which will save the selected item value and text in two installer properties (COMBO_VALUE and COMBO_TEXT).
- Go to "Dialogs" page and on [Next>] button (of your combo box dialog) add the following published events:
- Event: [AI_COMBOBOX_DATA]
Argument: COMBO_PROP
Event: Execute custom action
Argument: ExtractComboBoxData
Event: Execute custom action
Argument: ExtractSelectedItem
- Build and run your project.
Also, here's attached a sample, created with version 10.0 of Advanced Installer, which implements a similar scenario.
If you have any questions let us know.
All the best,
Daniel