InstallerContactSite Map

Answer

This example will explain how to refresh a ComboBox control after the dialog containing it was loaded without using the “twin dialog“ method.

Please follow these steps:

  • create a new Enterprise project and go to Dialog Editor page
  • add a new dialog, on this dialog add a combobox and a push button using the toolbox
  • set the combobox public property to "COMBO" from the right pane
  • create a VBScript file (.vbs) that contains this script:
Session.Property(“COMBO“)=“New value“
  • go to Custom Actions page and add the script as an attached custom action under the UI Custom Actions tree
  • now go to Dialogs page and add a published event on the button created that runs the custom action
  • build and run the package

When the dialog will appear the combox will have an empty value because the property was not set to any value, this is correct. Press the button created, this will run the custom action that sets the property attached to the combobox to the string “New value“. It is a known Windows Installer bug that it cannot refresh a combobox control after a dialog has been loaded. Only after switching to a different dialog the control is reloaded.

Here is what you have to do in order for the combobox property to be re-read:

  • go to Themes page and check "Use Enhanced User Interface"
  • go to Dialogs page and add a “SetProperty“ published event on the button you have added the custom action, schedule it after the custom action published event
  • set the published event like this:
NameArgument
[AiRefreshDlg]1

Rebuild the package and test it, you will see that after you press the button the combobox will display the new value of the property.

ImportantPlease note that this can be done only if you have Enhaced User Interface activated.