This article was originally published in the January 2001 issue of the InstallShield Newsletter
Abstract: InstallShield Professional - Standard Edition has an open architecture that allows you to customize existing dialogs or to create your own wizard dialogs from scratch. But there are also ways to tweak and improve your setup's user interface with less effort. This article lists various methods to customize dialogs and shows some tricks and tweaks.
You can add or edit static text on the dialogs, hide, move or resize controls like buttons or edit boxes, etc. by modifying the dialog template that is stored in a DLL. This procedure is described in Knowledge Base article Q104953. I'm not going to reiterate this article here, but want to emphasize some points and give additional hints:
Changing the behavior of an Sd dialog was relatively easy in InstallShield 5 because they are script driven and their .rul files were included and could be edited. In InstallShield 6 this is no longer the case: the dialog scripts are delivered in pre-compiled library files that can't be modified. InstallShield 5 is included on the InstallShield 6 CD-ROM so you could grab the .rul files from there. However you will have to adjust these scripts to work with InstallShield 6, and sometimes they won't work at all because the internal functionality has changed, e.g. for component views. To properly set the text on the white banner at the top edge of the Windows 2000 style dialogs, add this line to the DLG_INIT part of the dialog script:
SdSetDlgTitle(szDialogName, hwndDialog, szTitle);
The hwndDialog window handle can be retrieved by calling CmdGetHwndDlg (szDialogName). The szTitle specifies the text that should be displayed on the white banner. Note that two lines of text can be displayed here, so this string can contain a line break character "\n". The first line will be drawn with bold font.
The latest version of InstallDialogue (see below) enables you to hook into the dialog events and modify the behavior of InstallShield 6 dialogs without access to the script code.
By default, the wizard dialogs show the text "InstallShield Wizard" in the title bar, and on the button in the task bar. You can easily change this to display your application name instead with the following function call:
SetTitle("Your Application Name Setup", 0, BACKGROUNDCAPTION);
Note that this will only work if you are not using a main setup window. If you have changed the default behavior and enabled the background window, the above line will change the title bar of the main window, not the wizard dialog.
In the upper right corner of the Windows 2000 style dialogs, in the white banner, a computer icon is shown by default. You can replace this icon with your own image or logo, by calling the InstallShield function:
DialogSetInfo(DLG_INFO_ALTIMAGE, SUPPORTDIR ^ "my.bmp", TRUE);
The default icon bitmap has a size of 67 x 53 pixels and uses 256 colors (see figure 1). Your custom bitmap should use the same color depth.
Figure 1: The default icon
In the default bitmap, teal (red = 0, green =128, blue = 128) is used as transparent color. If you want to support transparency in your custom bitmap, you must change the second parameter you pass into DialogSetInfo like this:
DialogSetInfo(DLG_INFO_ALTIMAGE, SUPPORTDIR ^ "my.bmp;1;;;0,128,128", TRUE);
To use a different transparent color, change the last three numbers to its RGB code (in decimal, not hexadecimal numbers)
You are not limited to the default bitmap size, it may cover the whole white bar (498 x 59 pixels). This can be used to create effects like shown in Figure 2. If your graphic is smaller, it will be centered vertically in the white banner and right aligned. Note that the text is written on top of the image, it is not part of the bitmap. You should avoid dark colors in your graphic to keep the black text readable.
Figure 2: A bitmap that covers the whole banner area
The first (Welcome) and last (Finish) dialogs in a setup have a different layout: A white background with a large blue bitmap on the left side. On this bitmap, an icon image is shown. This is the same graphic as in the upper right corner of the other dialogs, and can be replaced with the same function call. Note that the large blue bitmap cannot be changed in this way, only the icon that is displayed on top of it. The maximum size for a replacement icon on this dialog is 129 x 59 pixels, larger images will be right aligned and clipped on the left. So it is be possible to use the same 498 x 59 banner as above, which results in an effect as shown in figure 3.
Figure 3: Welcome dialog with alternate image
To change the large blue background image, you must edit the dialog resource as described above, or call the IdSetWelcomeFinishBitmap function of InstallDialogue.
Throughout this article, a tool called InstallDialogue has been mentioned several times. Here is some additional information about it: InstallDialogue is an add-on for InstallShield 6 (a version for InstallShield 5 is also available). It can create custom dialogs or modify existing dialogs with script commands. It also includes a dialog editor with a look and feel similar to Visual Studio. The latest version of InstallDialogue enables you customize the behaviour of the standard Sd dialogs without having the source .rul file available. Some sample code is available that uses the technique:
Some other features of InstallDialogue that I want to point out:
The InstallDialogue runtime files come as InstallShield Object that you can easily plug into your project. A fully functional Free Edition (displays a note upon startup) is also available. For more information see http://www.moonsea.com
Stefan Krueger is working as freelance setup consultant. Besides his contract work, he answers questions in various newsgroups and maintains the InstallSite.org web site, a place where setup developers share resources and information among peers.
If you have any comments about this article, or want to suggest a topic that Stefan should discuss in a future article, please write to . To read Stefan's articles from previous issues of the InstallShield Newsletter, please visit http://www.installsite.org/isnews.htm.
|News||Discussions||Windows Installer||Related Tools||More Help||InstallScript||About InstallSite||Shop||Site Search|
|Neuigkeiten||Diskussionsgruppen||Windows Installer||MSI FAQ||Artikel||Shop||Suche|
Copyright © by InstallSite Stefan
Krueger. All rights reserved. Legal
By using this site you agree to the license agreement. Webmaster contact