|
PLACES TO GO:
|
|
Customized Dialog Boxes in InstallShield 6
This is a brief HOWTO about making customized dialog boxes work in InstallShield Professional 6.x. The documentation provided by InstallShield Corp
on exactly how to do this is shockingly lacking in details and specifics. The process is really simple, actually, but their
instructions leave much to be desired. This is for myself and everyone else who tried to Google this out and was unsuccessful.
WHAT YOU NEED:
InstallShield Professional 6.x -- Mine was 6.12 but I suspect these instructions will work for all 6 series and perhaps even the 5
series. YMMV.
Microsoft Visual C++ -- Mine is version 6.0 so I know it works with this version; I cannot guarantee other versions but it should
work.
A working knowledge of InstallShield Professional. I am not going to write these instructions at a completely newbie level.
An I-know-enough-to-be-dangerous knowledge of Microsoft Visual C++. You don't need to know how to program in C++, but you do need
to know simple concepts such as how to compile a project, how to see and manipulate resources, etc. Some of this will be explained
but I won't be explaining each mouse click.
WHAT THIS HOWTO IS NOT:
This is not a HOWTO on making an entirely new dialog box for InstallShield; it is only for customizing
pre-existing, standard issue dialog boxes shipped with the InstallShield project.
THE CONCEPT:
Despite the documentation's badly written explanation of the idea of custom dialog boxes, it is a really simple
concept. InstallShield pulls all of its dialog boxes from a DLL called "_isres.dll". Yes, that's an underscore and it is part of the
name. Normally, this is just how things work. However, if you put a DLL called "_isuser.dll" in your Setup Files pane of your
InstallShield project, InstallShield will look in that DLL first. If it sees a dialog box inside there that has the same
resource ID as one inside "_isres.dll", then it will use the "_isuser.dll" version instead of the "_isres.dll" one.
Neat idea, hrm?
So, all you have to do to make a custom dialog box is to copy the dialog box resource from "_isres.dll" into "_isuser.dll" and change
it the way you want, copy it into your Setup Files pane of your project, build the project, and run it.
THE STEP-BY-STEP:
- Open up InstallShield. Go to Tools-->Dialog Sampler. This is an IS project that contains every instance of dialog boxes that are
standard to the IS environment.
- Inside the Dialog Sampler project, find the dialog you want to customize in the list on the left-hand side. Hilight it by clicking
once on it.
- On the right-hand side, you will notice a box called Resource ID. A number will be in here. Write it down. This is the Resource ID
of that dialog box. For instance, the SdLicense dialog box is resource ID 12029.
- Close the Dialog Sampler project by clicking Cancel and answering Yes.
- Find your copy of the sample "_isuser.dll" Visual C++ project. It comes with your InstallShield installation and should already be
installed under <InstallShield Drive and Location>\Examples\Custom Dialog\VC++ 6 Project. If not, or you want to work with
a project that has been cleaned up a bit, I've provided a ZIP file of the project I used.
Download it here (isuser_project.zip).
- Open up the "_IsUser.dsw" file inside Visual C++ (hereafter referred to as VCC) by double-clicking on it or opening VCC and choosing
File-->Open Workspace.
- Make sure you have the workspace visible on the left. You should see three tabs at the bottom: ClassView, Resources, FileView. If
you don't see the workspace, turn it on by choosing View-->Workspace.
- Make sure you are on the Resource pane.
- Expand the "_IsUser resources" folder.
- Expand the "Dialog" folder
- If you used my custom project ZIP file, the Dialog folder is empty. If you use the one that came with IS, it contains two
sample dialog boxes. You can delete those safely. Just click on each one once and hit your Delete key.
- Choose File-->Open.
- Change "Files of Type" to "Executable Files (.exe;.dll;.ocx)" and change "Open as:" to "Resources". This will enable you to open
a DLL file a look at its resources (such as icons, and most importantly, dialog boxes).
- Locate "_isres.dll". It should be under <InstallShield Drive and Location>\Redistributable\Compressed Files\0009-English\Intel 32 --
this is the main copy used by the program. Other "_isres.dll" files will be included with the installation but they may or may not be the
proper ones (I haven't figured that out yet). Choose this file and click Open to open it as a resource.
- The "_isres.dll" resources will appear on the left-hand pane. Expand the Dialog folder to show all dialogs. Find the dialog
with the Resource ID that you identified above.
- If you have this all setup right, on the left pane you should see the dialog folder for "_isuser.dll", on the right pane you should
see the dialog folder for "_isres.dll". Drag and drop the numbered dialog from the right pane (_isres.dll) to the left pane (_isuser.dll)
and put it under the correct folder (Dialog). This will copy that resource to the new, custom DLL.
- Close the right-hand "_isres.dll" pane.
- Make sure your project is in Release mode. To change it, choose Build-->Set Active Configuration and choose Release.
- Hit the F7 key to compile the DLL.
- Assuming you get a message saying, "_IsUser.dll - 0 error(s), 0 warning(s)", then we're cooking with gas. If you get any errors,
double-check your work.
- Now you have a custom DLL with the dialog box you want to modify. Now it's time to modify the dialog box.
- Double-click on the dialog resource on the left-hand pane to open it up. It should appear on the right-hand pane.
- Edit away. This part I can't direct you much on, you have to know what you're doing. A hint: Right-clicking on objects, choosing
"Properties", and adjusting values there is usually what you want.
- NOTE: You can only edit certain things.
Things you CAN do:
- You can change static text. This includes text in the title, text in the buttons, text in the text fields, etc.
- You can add static text -- this means text fields only (or adding to pre-existing text objects)
- You can add a text field that contains the product name. IS is smart enough to parse through text fields and look for
the placeholder "%P". If it finds one of these, it replaces them with the Product Name. You have to give the text fields a unique
ID from 701 to 799 in order for this replacement to happen (that's the ones that IS scans).
- You can change accelerators. These are the underlined letters in buttons that let you use the Alt key and that letter to make
a shortcut to that button. You can move and change and remove accelerators all you want.
- Moving controls -- You can move stuff around on the screen all you want.
- Changing visibility of controls -- You can make controls visible or invisible all you want (under Properties there is a Visible checkbox)
Things you CANNOT do:
- You cannot delete controls. There are some for each dialog that IS expects, including some invisible ones. Do not delete anything!
Instead, make it invisible.
- You cannot add buttons. That falls outside of this tutorial and into making new dialog boxes.
- You cannot change the IDs of controls already on the page. If you modify a control (button, text field, etc.) you have to leave the
ID alone.
- After you make your appropriate changes, hit the F7 key again to compile the project. Again, assuming you get no errors, we're doing
well.
- Close VCC.
- Open IS.
- Open the IS project you want to have these custom dialog boxes inside.
- Go to the Setup Files pane.
- Open the Language Independent --> Operating System Independent section. On the right-hand pane, right-click and choose Insert File.
- Find the "_isuser.dll" file under the Release folder of your VCC project we just worked on.
- Insert that file.
- Hit F7 to build your IS project.
- Run your project. The dialog boxes should be replaced with your version.
Custom Button Images for SdOptionsButtons
I've learned a few things about these. To do this, you follow the basic same instructions as above and add dialog
12026 to your _isuser.dll project. However, you don't have to modify it. What you do instead is you create one or more
new Bitmap resources with the same IDs as the originals. These override the originals, just like your custom dialogs
override the originals. Here's the basic idea:
- Follow the directions through #20 above to add dialog 12026 to your project.
- Go to the Resources tab.
- Right-click on the _IsUser resources folder at top, choose "Insert"
- Choose Bitmap and then "New"
- You'll get a new bitmap in the right-hand panel. Now, you can either use the (rather primitive) tools at the right to edit the image directly, or you can cut-and-paste from a graphics program (like Paintshop Pro). I recommend the latter. It must be a 48x48 pixel Bitmap image, 256-colors. No more, no less. One color, keep in mind, you can specify as the "transparent" color. Look at the Help syntax for SdOptionsButtons.
- When you get done editing, right-click on the Bitmap resource you just created and choose Properties.
- In the "ID" box, type one of the existing IDs which are 12001 through 12004. Yes, you can only have 5 different Bitmaps. Yes, it sucks.
- Close the Properties box.
- Save the project.
- Follow the rest of the instructions above from step 25.
- Voila!
WARRANTY:
I don't warranty the directions in this guide to be correct or to even work. They are simply here as an example of
what I have tried and worked. Your mileage can and will probably vary to some extent or another. If you find an error in these
instructions or have questions, you can try Contacting Me.
This site and all content (C)2002-2008 Nathan E. Pralle (www.nathanpralle.com).
|