Creating custom dialogs is a common task in InstallScript MSI and InstallScript projects. The first step in creating a custom dialog is to clone an existing one. When you first do this, you can get stuck on a small issue. I’ll tell you how to get past that issue.
First off, here are the steps you need to perform in order to clone a dialog box:
- In the Dialogs view, right-click the dialog you want to clone and select Edit.
- In the Dialogs view, right-click same dialog and select Clone.
- In the Dialogs view, rename the newly-cloned dialog.
- In the Direct Editor view, Dialog table, change the new dialog’s (cloned dialog) ISResourceId to a unique value.
- In the Dialogs view, right-click the original dialog that was cloned and select Revert Dialog to Default.
Now, let’s go through the steps. First we right-click the dialog we want to clone and select Edit. In this case, we want to clone the SdAskDestPath2 dialog. Here is the screenshot of the Dialogs view after we have done that. Realize that I have squeezed the InstallShield IDE a bit so I can fit the screenshot into this blog page.
After the SdAskDestPath2 dialog has been edited
You can see that the Resource Identifier of the SdAskDestPath2 dialog is 12067.
The next screenshot shows the Dialogs view after we have cloned the dialog and renamed the cloned dialog.
After the dialog has been cloned and the new dialog has been renamed
Notice the cloned and renamed dialog has the same Resource Identifier as the original SdAskDestPath2 dialog. This is a problem and we need to assign a new identifier to the new dialog. The problem is that this property is often disabled after you have cloned the dialog. I don’t know why. But, it means you can’t change the Resource Identifier of the new dialog from this view and you must change this Resource Identifier. If you don’t, InstallShield will become confused.
You can see what I mean by closing your project at this time and reopening it. When you look in the Dialogs view, your newly-cloned dialog will probably be gone. So, you’ll have to start the process over.
This next screenshot shows the Dialog table in the Direct Editor view.
Dialog table in the Direct Editor view
In this screenshot, I have come to the Dialog table and I am going to change the Resource Identifier from here. Remember, you have renamed your cloned dialog and it’s now called AB_SdAskDestPath. When you look at the ISResourceId column, it says 12067. That’s the same as SdAskDestPath2.
Now, look at the other custom dialogs in the table. I have previously assigned them identifiers of 13001 through 13004. So for the AB_SdAskDestPath dialog, we will change the ISResourceId column value from 12067 to 13005.
At this point, you have cloned a dialog and reassigned it’s Resource Identifier. Now, when you close and reopen your project, it will still be there. Remember you will still need to go back to the Dialogs view and perform the last step given above.
If you follow these steps, you will be able to clone a dialog with no trouble. You will still have to change the dialog and write a script for it, but that’s another story.