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]: /Dialog[Next]: DialogPreview
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Source Code->Commands->DialogEntry

The "DialogEntry" Command

This command should only be used between "Dialog" and "/Dialog commands and is used to defined an entry field (including its label).

This command supports simple text entry fields as well as more complex controls like list or combo boxes. The "Read Me Dialogs" tip shows you how to create an empty dialog and add some controls that the "DialogEntry" command doesn't support.

Most often you statically define list items but if you need to examine the environment at install time to determine the options then you should see the "Dynamically Update Dialog Controls" tip.

This command takes these parameters:

Example of how it might look

The following picture has my configured "look and feel" (titlebar's contents, graphic bar on top, the icon in it and the bottom line etc). The Dialog ID is in the titlebar by choice as I built the dialog in "development mode".

It may also not exactly match the sample code as I may not keep this picture in exact sync with the code (either due to lack of time or bad memory).

Examples

;--- Insert after which dialog? (I never have a "UserRegistrationDlg") ------
#ifdef REMOVED_LicenseAgreementDlg          ;;Only exists if the dialog has been removed...
       #define InsertAfter WelcomeDlg
#else
       #define InsertAfter LicenseAgreementDlg
#endif

;--- Actually create the dialog and insert into the UI ----------------------
<$Dialog "Test Dialog #1" INSERT="<$InsertAfter>" Dialog="MyFirstSettingsDialog">
    ;--- Two entry fields with tooltips (one a password field) --------------
    <$DialogEntry Property="ANSWER1" Label="&Name:"     ToolTip="Enter the users name (max 10 characters)"     Max=10 Width=200>
    <$DialogEntry Property="ANSWER2" Label="&Password:" ToolTip="Enter the users password (max 20 characters)" Max=20 Password=Y>
    <$PropertyList "MsiHiddenProperties" Value="ANSWER2">   ;;Should not be logged...

    ;--- Try a "MaskedEdit" type entry field --------------------------------
    <$DialogEntry Property="ANSWER3" Label="IP &Address:" Control=^ME:###.###.###.###^ ToolTip="IP address (4 bytes 0-255)">

    ;--- Try an entry field which is validated via a regular expression -----
    <$DialogEntry Property="ANSWER4" Label=^&Start with "ABC":^ BLANK="Y" MatchRe="^ABC.+$" CASE="?" ToolTip=^Min 4 characters starting with "ABC" (any case)!^>

    ;--- Entry field for an integer in the range 80-90 ----------------------
    <$DialogEntry Property="ANSWER5" Label="Want &Integer 80-90:" Max="2" Width=35 Integer="80 to 90">

    ;--- Add a combo box (user can choose existing or enter their own) ------
    #data 'ComboBox_ANSWER6' 2
        ;--- Define sounds and a test description shown in the pull down ----
        "woof woof"     "Dog"
        "quack quack"   "Duck"
        "bah bah"       "sheep"
        "moo moo"       "cow"
        "meeow meeow"   "cat"
    #data                       ;;Note that we dynamically add a couple of entries in the custom action below
   <$DialogEntry Property="ANSWER6" Label="Choose a sound:" Control="CB">

   ;--- Check Box -----------------------------------------------------------
   <$DialogEntry Property="ANSWER7" Label="Want more Money?:" Control="XB:False|True" ToolTip="A silly question...">

   ;--- A Radio Button ------------------------------------------------------
   #data 'RadioButton_ANSWER8'
         ;--- All buttons on same dialog line (not over 3) ------------------
         'Yes'   'I accept'               '50'  'Got heaps of money have you?'
         'No'    'No way in a fit!'       '75'  'Smart decision...'
         'Maybe' "Maybe, Oh I don't know" '130' 'Oh well not everyone has brains'
   #data
   <$DialogEntry Property="ANSWER8" Label="Buy car for $1,000,000:" Control="RB">
<$/Dialog>


;--- A second dialog --------------------------------------------------------
#define? TRYME_INCLUDES_LISTVIEW        Y       ;;Y/N - Only room for ONE ListBox or ListView!
<$Dialog "Test Dialog #2" INSERT="MyFirstSettingsDialog">
    ;--- A text only line ---------------------------------------------------
    <$DialogEntry Label="Want to remove Existing files?" Control="Text" LabelWidth="300">

    ;--- The radio button ---------------------------------------------------
    #data 'RadioButton_REMOVE_FILES'
           'Yes'   'Yes'  ''    ^Please note that your Data can't be recovered!^
           'No'    'No'   ''    ''
    #data
    <$DialogEntry Property="REMOVE_FILES" Label="" Control="RB" LabelWidth="0">

    ;--- Which control? -----------------------------------------------------
    #if ['<$TRYME_INCLUDES_LISTVIEW $$UPPER>' = 'N']
        ;--- A ListBox ----------------------------------------------------------
        #data 'ListBox_LIST_VALUE' 2
            ;--- Define sounds and a test description shown in the pull down ----
            "One"   "Choose Me #1"
            "Two"   "Choose Me #2"
            "Three" "Choose Me #3"
            "Four"  "Choose Me #4"
            "Five"  "Choose Me #5"
            "Six"   "Choose Me #6"
            "Seven" "Choose Me #7"
            "Eight" "Choose Me #8"
            "Nine"  "Choose Me #9"
        #data
        <$DialogEntry Label="Choose a listbox value:" Control="TEXT">                                     ;;Want label on its own line
        <$DialogEntry Property="LIST_VALUE" Control="LB" LabelWidth="0" Label="Choose a listbox value:">  ;;Re-specify label ONLY for any failed validation message (don't display it here)
    #else
        ;--- A ListView ---------------------------------------------------------
        <$Binary Key="SomeGraphic.ico" "TryMe.ICO">     ;;Obviously in a real application you'd use more than one graphic!
        #data 'ListView_LIST_VALUE' 3
            ;--- Define sounds and a test description shown in the pull down ----
            "One"   "Choose Me #1"     "SomeGraphic.ico"
            "Two"   "Choose Me #2"     "SomeGraphic.ico"
            "Three" "Choose Me #3"     "SomeGraphic.ico"
            "Four"  "Choose Me #4"     "SomeGraphic.ico"
            "Five"  "Choose Me #5"     "SomeGraphic.ico"
            "Six"   "Choose Me #6"     "SomeGraphic.ico"
            "Seven" "Choose Me #7"     "SomeGraphic.ico"
            "Eight" "Choose Me #8"     "SomeGraphic.ico"
            "Nine"  "Choose Me #9"     "SomeGraphic.ico"
        #data
        <$DialogEntry Label="Choose a listview value:" Control="TEXT">                                                 ;;Want label on its own line
        <$DialogEntry Property="LIST_VALUE" Control="LV" Width="120" LabelWidth="0" Label="Choose a listview value:">  ;;Re-specify label ONLY for any failed validation message (don't display it here)
    #endif
<$/Dialog>

See the "TryMeWithUserDialog.MM" sample to see a complete example with realistic supporting code.


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]: /Dialog[Next]: DialogPreview


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Saturday December 09 2017 at 9:30am
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.