MAKEMSI quickly and reliably creates MSI files in a non-programmatic way
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
[Bottom][Contents][Prev]: Start Program at End of Install[Next]: Uninstall Shortcuts
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Tips and Tricks->User Interface Tips->Twin Dialogs

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:

  1. "ControlCondition" table
  2. "ControlEvent" table
  3. "EventMapping" table
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>


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: Start Program at End of Install[Next]: Uninstall Shortcuts


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Sunday August 13 2017 at 2:39pm
Visit MAKEMSI's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.