PDA

View Full Version : Conditional Dialog Behavior driven from Feature Selections



marc.gibian
09-07-2005, 09:23 PM
I am working with a pair of existing InstallShield basic MSI projects, folding the smaller of them into the larger one. The biggest impact I've found is a significant increase in conditionality across the board, and a need to handle pre-requisites in a less than absolute manner.

I have a feature, say FOO, that is dependent on a product not commonly installed for any reason but to support this feature. Thus, I only want to enforce it as a pre-requisite when that feature is selected. My current approach is to:

1 - Use a System Search to set the property INSTALLED_PRODUCT_VERSION to the installed version of the required product as read from a registry key that is present and containing this value only if the product is installed.

2 - Placed a Condition on the Feature FOO that sets the level to 999 (not being installed) if the INSTALLED_PRODUCT_VERSION property is "".

3 - Add a new NewDialog Behavior for the CustomSetup "Next" control that tests if the feature is selected and the pre-requisite version is "", which brings up an informational dialog explaining the lack of the required product.

1 & 2 work great, but 3 is giving me trouble. The test I'm using is:

FOO <> 3 And INSTALLED_PRODUCT_VERSION = ""

I've tried each of the clauses on its own, and the second clause if fine, but the first clause never works, no matter what I do. Yet this is exactly the same way I test a feature's selection state elsewhere in the install.

My questions:

- Why is this not working? I am suspecting that the property value is not updated to reflect the changes in user selection when Next is clicked until AFTER the event is evaluated, but I can't find any documentation that might clarify what is happening.

- What would be an approach to this task, of testing for a pre-requisite only when a feature is selected... Perfect would be triggering an error dialog when a user attempts to select a feature whose pre-requisite is not present. I didn't see a way to do that, which is why I tried my current approach. Something that provides the user with the needed error "soon enough" is all I need, and I believe "soon enough" means when the user attempts to leave the CustomSetup dialog and move forward in the install.

Thank you for your help and patience in reading this posting.

-Marc