cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Snoopstah
Level 7

Installscript Custom dialog

Having come from a basic MSI background I am having a little difficulty customising and existing InstallShield dialog.

I want to change the SQLServerSelectLoginDialog to look like the attached picture.

What I can't work out how to do is to dispaly the dialog with some default values and to enable/disable the combo box depending the radio button selection.

I want the SQL Server Connection to default to "Use existing SQL Server already installed on this computer". If this option is chosen then ALL fields on the dialog box should be enabled.

If the use chooses to install a new SQL Server instance, then every option on the dialog box should be disabled so the user can only then choose next/back/cancel or to change their radio control back to "use existing SQL Server..."

How can I do this? It seemed quite easy using BASIC MSI dialog editor, but not so easy now that I'm using InstallScript.....
Labels (1)
0 Kudos

(5) Replies
m_rudolph
Level 6

First you want to clone the dialog I think, so you can create a function to perform the tasks you need.

Just get the Control Identifiers of all fields and follow this URL:

http://helpnet.installshield.com/robo/projects/helplibdevstudio9/Dialogs_ImplementStandard.htm

Look up 'Custom Dialog Functions' in the help for a list of functions you can use.

Should be enough to get you started.
0 Kudos
Snoopstah
Level 7

Perfect. Thankyou for that!

I only have one question. How do I clone the dialog? If I right click on the dialog in Dialogs View, Clone option is disabled. The only option is Edit.
0 Kudos
m_rudolph
Level 6

Select Edit first, and then the options open up for you.

I should also say that this dialog in stock form probably has somewhat complex script behind the scenes. I don't see it being too productive to write the entire thing from scratch just to enable/disable fields.

If you look in C:\Program Files\Macrovision\IS2008\Script\SQLRunTime\Src there are .rul files for whatever dialogs you're trying to modify.

I have never tried it, but I think you can just modify that script to do what you want. Just make a copy of it and work from that file.
0 Kudos
spdygnlz
Level 2

I just happened to be researching this today. Here's what I found:

Make sure you define the Control ID of the control
#define YOUR_CTRL_ID 1303
#define RADIOBUTTON_ID 1304


Make sure you declare the handles you'll be using.

function MyCustomDlg()
HWND hDlg, hCtrl;
begin


I actually do this in the DLG_INIT case in the loop. I don't know if you have to.

case DLG_INIT:

// Start by getting a handle to the dialog
hDlg = CmdGetHwndDlg("YourDialogName");


In the Radio button case of the loop, check the condition and then enable/disable.

if (CtrlGetState("YourDialogName", RADIOBUTTON_ID) == BUTTON_CHECKED) then
// Get a handle to the control
hCtrl = GetDlgItem(hDlg, YOUR_CONTROL_ID);

// Disable (or Enable) the control
EnableWindow(hCtrl, FALSE);
endif;


Hope that helps!

-spdygnlz-
0 Kudos
Michael_McBrine
Level 4

Excellent post.
works perfect thanks a bunch
--Mike
0 Kudos