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]: Dynamically Update Dialog Controls[Next]: FilesInUse Dialog - Display if Program Running
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->Error Dialog - Improve

Error Dialog - Improve

This is a User Interface Tips example to demonstrate how MAKEMSI can may "on the fly" changes to a standard template allowing you to accept templates from other people.

The error dialog is much too small to provide any real detail when a problem exists, worst still it removes (seemingly random!) parts of your message in a attempt to make it fit in, making your message unreadable or perhaps completely altering its meaning! Its other problems are you can't copy and paste error text into an email etc and that sometimes carriage return/line feed sequences are not rendered correctly.

This example shows how I modify the error dialog (in "uisample.msi") such that the message area is much larger and uses the "ScrollableText" control so that if the message is too wide or high you will still be able to read the whole message.

;--- Make how much bigger? User can override size increase ------------------
#define? UISAMPLE_ERRDLG_INCREASE_WIDTH  150
#define? UISAMPLE_ERRDLG_INCREASE_HEIGHT  80
#define? UISAMPLE_ERRDLG_TYPE             Text
;**    [CommentBlockStart     (September 25, 2003 5:41:48 PM EST, Dennis)
;**+----------------------------------------------------------------------
;**|#define? UISAMPLE_ERRDLG_TYPE             ScrollableText    ;;Adds vertical scrollbar if required (lines wrap)
;**+----------------------------------------------------------------------
;**    CommentBlockEnd]       (September 25, 2003 5:41:48 PM EST, Dennis)
#DefineRexx ''
    HalfIncreaseWidth  = <$UISAMPLE_ERRDLG_INCREASE_WIDTH> / 2
#DefineRexx

;--- Normally Width=270, Height=105 -----------------------------------------
<$Table "Dialog">
    #(
       ;--- Adjust height and width as requested ----------------------------
        <$Row
              @Where=^`Dialog` = 'ErrorDlg'^
            @SelfRef="{*}"
                 @OK=^? = 1^
              *Width=^{*} + <$UISAMPLE_ERRDLG_INCREASE_WIDTH>^
             *Height=^{*} + <$UISAMPLE_ERRDLG_INCREASE_HEIGHT>^
        >
    #)
<$/Table>
<$Table "Control">
    #(
        ;--- Move all the buttons down/right --------------------------------
        <$Row
              @Where=^`Dialog_` = 'ErrorDlg' and `Type`='PushButton'^
            @SelfRef="{*}"
                 @OK=^? > 0^
                  *X=^{*} + <??HalfIncreaseWidth>^     ;;Buttons centered
                  *Y=^{*} + <$UISAMPLE_ERRDLG_INCREASE_HEIGHT>^
        >
    #)
    #(
        ;--- Fix up the Text control ----------------------------------------
        dim ErrorTextControlAttr<?NewLine>
        #if ['<$UISAMPLE_ERRDLG_TYPE>' = 'Text']
            ErrorTextControlAttr = msidbControlAttributesNoPrefix
        #elseif
            ErrorTextControlAttr = 0
        #end if
        <?NewLine>
        <$Row
                @Where=^`Dialog_` = 'ErrorDlg' and `Control`='ErrorText'^
              @SelfRef="{*}"
                   @OK=^? = 1^
                   Type="<$UISAMPLE_ERRDLG_TYPE>"
           *Attributes=^{*} or ErrorTextControlAttr^
                *Width=^{*} + <$UISAMPLE_ERRDLG_INCREASE_WIDTH>^
               *Height=^{*} + <$UISAMPLE_ERRDLG_INCREASE_HEIGHT>^
        >
    #)
<$/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]: Dynamically Update Dialog Controls[Next]: FilesInUse Dialog - Display if Program Running


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Saturday May 28 2022 at 3:11pm
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.