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>