Answer

TipThis How-To can be implemented only in an Advanced Installer Enterprise or Architect project.

This article explains how to refresh a dialog after modifying properties that were used on that dialog.

With Enhanced UI

In order to initiate a refresh on an Enhanced UI Dialog, you only need to set the AiRefreshDlg property after your property has been updated. Each time AiRefreshDlg is being set, the user interface refreshes.

Below is a sample VBScript that retrieves the value of MYPROP, increments it by one, then updates the property with the new value. Upon this modification, the dialog needs to be refreshed, so the AiRefreshDlg property is set to "1" (Note the conversion to a string by using "cstr")

Dim x

'Retrieve the value of MYPROP
x = Session.Property("MYPROP") 

'Test if MYPROP is empty (i.e it does not already exist). If it is, initialize it
If x = "" Then
  x = 0
Else
  'Increment x
  x = x+1
End If

'Write the incremented value back into MYPROP
Session.Property("MYPROP") = cstr(x)

'setting AiRefreshDlg refreshes the controls on a dialog when Enhanced UI is enabled
Session.Property("AiRefreshDlg") = cstr(1)
        

You can save the above script in a .vbs file and add it as a UI Custom Action in Custom Actions page. You can then call it by placing a DoAction Published Event on a button. Make sure you also have a static text with the "Property" field set to "MYPROP" and the "Text" field set to "[MYPROP]" on the same page with your button, so you can see the updated value.

Without Enhanced UI

The UpdateMsiEditControls Custom Action is responsible for refreshing an MSI Dialog. Described below is the proper usage of this custom action.

On the Custom Actions page, right click "UI Custom Actions" and select "Add Predefined UI Custom Action"->"Update MSI Edit Controls"

On the Dialogs page, select the button that initiates your custom action (the one that modifies the property)

On the Published Events tab, add a new Published Event by pressing the [ New... ] button.

Set the "Name" field to "DoAction" and the "Argument" to "UpdateMsiEditControls" on the "New Control Event" dialog.

Use the [ Down ] button to the right to make sure the "UpdateMsiEditControls" event is below the event that sets the property.

Caution!Note that the custom action that modifies the property needs to be set as Synchronous so that the UpdateMsiEditControls Custom Action does not start before the property is modified.