Summary
Populate a ComboBox control at runtime with VBScript.
Synopsis
It is possible to populate a ComboBox at runtime of an .msi using a VBScript custom action.
This is intended for the Basic MSI project type.
Discussion
Create a VBScript custom action and schedule it to run before the dialogs in the UI sequence.
This VBScript example will create 2 entries in the ComboBox added to a dialog.
PROPNAME is the name of the MSI property used in the ComboBox.
Steps:
- Select a dialog and add the ComboBox Control
- When prompted to specify a property enter: PROPNAME
- In the Installation Designer view, go to the Custom Actions and Sequences view
- Right click on Custom Actions in the middle panel and select New VBScript->Stored in custom action
- In the Common tab -> Sequence section, sequence it to run prior to dialogs in the UI sequence
- In the Script tab use code similar to the example below
Here is some sample VBScript code:
Const msiViewModifyInsertTemporary = 7
Set oView = Session.Database.OpenView("SELECT * FROM `ComboBox`")
oView.Execute
Set objRecord = Session.Installer.CreateRecord(4)
objRecord.StringData(1) = "PROPNAME" 'MSI Property Name used in Combobox
objRecord.IntegerData(2) = 0 'Entry number in Combobox 0 starting position.
objRecord.StringData(3) = "a" 'Value to be stored in MSI Property
objRecord.StringData(4) = "1" 'Text displayed for Entry
oView.Modify msiViewModifyInsertTemporary, objRecord
objRecord.StringData(1) = "PROPNAME" 'MSI Property Name used in Combobox
objRecord.IntegerData(2) = 1 'Entry number in Combobox
objRecord.StringData(3) = "b" 'Value to be stored in MSI Property
objRecord.StringData(4) = "2" 'Text displayed for Entry
oView.Modify msiViewModifyInsertTemporary, objRecord
?oView.CloseWas this helpful?
Related Articles
How to Dynamically Populate a List Box at Runtime. 7Number of Views PowerShell Custom Actions Failing at Runtime 3Number of Views Setting the JVM Heap Size at Runtime 4Number of Views Error 1935 Occurs at Runtime 4Number of Views How do You Add a Flag so FlxCapabilityResponseGetVendorDictionary Detects Returns at Runtime? 8Number of Views
© 2026 Flexera Software. All Rights Reserved.