PDA

View Full Version : CustomSetup... customization



cnegrila
07-12-2006, 09:48 AM
I'm trying to disable the "Next" button on the CustomSetup dialog (the one that allows the user to select the features that he/she wants installed) if none of the features presented in the tree is selected for install. Unfortunately we don't have a "main" thing that could be installed in that case, so it wouldn't make sense.

I looked at the LicenseAgreement dialog because that one disables the Next button based on the radio button selection and tried to do the same here: in the Conditions tab for the Next button I created Disable/Enable actions with conditions like (&Feature1=3 Or &Feature2=3) and the negated one, but this doesn't seem to do anything.

Any idea how this should actually be done? (the above was just my beginner's guess) :confused:

Thanks!

catchen
02-12-2007, 09:49 PM
Hi,

I have the same problem and have been trying different ways, but no luck.

Anyone have any idea? There was a similiar posted without any answer:
http://community.installshield.com/showthread.php?t=161359&highlight=CustomSetup

Thanks
Catherine

LeslieEaster
02-13-2007, 10:24 AM
This is one of those classic Windows Installer moments. Just when you think you've got a handle on Windows Installer you get a curveball (MLB spring training starts next week!!).

Your assumption is that Windows Installer is servicing messages directly from the dialog--it's not. You've already seen the effects. Let me give you an example. Let's say we have three features: Feature1, Feature2, and Feature3. Next we set the Enable state of the Next button to disable when:

&Feature1<>3 And &Feature2<>3 And &Feature3<>3.

We also set the Next button to enable when:

&Feature1=3 Or &Feature2=3 Or &Feature3=3

Seems like it should work, eh? Not really. If you de-select the features and then select the Next button it's still enabled. But try selecting one of the other buttons first (try Back and then Next). Ah-ha! The Next button is now disabled.

The problem is that "message" that the features are all de-selected isn't processed by Windows Installer until we move off of the control and onto something else. The advantage of the radio button and check box is that these messages are processed immediately. That's why the License Agreement dialog works the way it does.

The bottom line. You can do this--it just isn't going to be as easy as you thought. Most folks write a custom action attached to the Next button. It queries for the state of the features and if they are all de-selected, a message box is displayed the user stays on the dialog until something is selected. This is done by having the custom action set a property that is then used as a condition on the NewDialog action of the Next button.

If you really want to get fancy you could write a custom action that sends a message directly to the Next button--enabling/disabling via the Windows API.

Hope that helps,

catchen
02-13-2007, 08:03 PM
Thanks a lot for the information.

Thanks
Catherine