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]: Licence Dialog Enabling[Next]: MSI Dialog Editor
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->Logo on Dialogs

Logo on Dialogs

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 standard dialogs (in "uisample.msi") have a white bar with a graphic on the right, the whole thing being scalable. With dialogs its important to know that they don't use pixels or any other common measurement so it is impossible to create an icon or bitmap and know how much dialog space it will cover.

Since the standard bar and graphic are combined and since graphics don't scale very well it is almost impossible to replace the standard graphic with your own and have it look reasonable.

The code below implements my solution which is basically to divide the graphic into two pieces:

  1. A very small white graphic which will replace the original one (called "bannrbmp"). It will be stretched to fill the original area and as its uniform there will be no artefacts.

  2. A bitmap logo which is placed on the right and set to be fixed size. To be really safe this graphic should have a white border to be 100% sure that the dialog color does not show through. All dialogs that have "bannrbmp" on them have a new control inserted into them for this logo graphic.
;--- MAKEMSI MSI smaller, use smaller banner graphic ------------------------
#define? UISAMPLE_BITMAP_WHITE_BANNER        white.bmp                                             ;;Pure white banner (no graphic)
<$Binary "<$UISAMPLE_BITMAP_WHITE_BANNER>"   KEY="bannrbmp"          DOCO="N" @Validate="FIELD">   ;;Very small image gets sized to fill area

;--- If user wants a small graphic on the banner (like original) then add it ---
#define? UISAMPLE_BITMAP_BANNER_GRAPHIC
#if ['<$UISAMPLE_BITMAP_BANNER_GRAPHIC>' <> '']
    ;--- User wants the small right hand side graphic -----------------------
    <$Binary "<$UISAMPLE_BITMAP_BANNER_GRAPHIC>" KEY="BannerGraphic.BMP" DOCO="N">                     ;;Will place fixed size bitmap on right of filled area
    <$Table "Control">
    #(
       ;--- Add new control for fixed size logo on right --------------------
       <$Row
            @Where="`Control` = 'BannerBitmap'"
           @Method="INSERT"
               @OK=^? > 0^
           Control="CompanyLogo"
                 X="330"
                 Y="10"
             Width="26"
            Height="26"
        Attributes="&H00100001"            ;;Fixed size bitmap
              Text="BannerGraphic.BMP"
      Control_Next=""
       >
    #)
    <$/Table>
#end if


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]: Licence Dialog Enabling[Next]: MSI Dialog Editor


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.