Twin Dialogs |
This is a User Interface Tips example, this technique can be useful to overcome Windows Installer Dialog features in some circumstances.
Assuming you have tried appropriate use of existing tables such as:
as well as the "SetProperty" ControlEvent and you can't get refreshes to occur no matter what. You should try the "Back" then "Next" button, to reload the dialog, if it then works then the method described below should also work.Reload Same Dialog |
The solution would appear to be to reload the same dialog however Windows Installer actively prevents this (stupid - given lack of any refresh capability).
The work around here is to create a "clone" of the dialog and when you need to refresh you simply switch dialogs ("A.DialogTemplate.1" in the example) to another that looks identical. The only issue might be focus but due to more Windows Installer limitations not much can be done about this (maybe a custom action could move focus?).
Basically what the following does is look for all rows related to a particular dialog and duplicate them with a new dialog name. Some dialog specific adjustment is then made so that they load each other.
;--- Duplicate relevant dialog entries --- #( #define DuplicateDialogEntries <$Table "{$InTable}"> #( <$Row @Where="`{$Column}` = 'A.DialogTemplate.1'" @OK=^{$OK=~? > 0~}^ {$Column}=^A.DialogTemplate.1_^ @Method="INSERT" @Validate="FIELD" > #) <$/Table> #) <$DuplicateDialogEntries InTable="Dialog" Column="Dialog"> <$DuplicateDialogEntries InTable="Control" Column="Dialog_"> <$DuplicateDialogEntries InTable="ControlEvent" Column="Dialog_"> <$DuplicateDialogEntries InTable="ControlCondition" Column="Dialog_" OK="? = ?"> ;;May not be any ;--- Enable the dialog swaps (when "Next" custom action validation fails) --- <$Table "ControlEvent"> #( <$Row Dialog_="A.DialogTemplate.1" Control_="Next" Event="NewDialog" Argument="A.DialogTemplate.1_" Condition="not (1 = VALID.A.DIALOGTEMPLATE.1)" Ordering="3" > #) #( <$Row Dialog_="A.DialogTemplate.1_" Control_="Next" Event="NewDialog" Argument="A.DialogTemplate.1" Condition="not (1 = VALID.A.DIALOGTEMPLATE.1)" Ordering="3" > #) <$/Table>