View Full Version : Help with standard project

07-30-2002, 10:30 AM
IS Dev 7.04.

We have several products. Each has different dependencies on various differet levels of technologies that can be installed by merge modules (MDAC 2.6, MDAC 2.7, MSXML, Access, Jet, etc.) and which may change during the development cycle. Because we want to be able to change whether or not the given merge module is checked and installed at run time before the install is executed, I create several non-visble features in every project (MDAC 2.6, MDAC 2.7, MSXML 3, MSXML 4). At run time the install reads input from an INI file (in the OnAppSearch event) to determine which technologies to check for and install.

How do I enable the non-visible features at this time (OnAppSearch)? Do I need to set the features later in the script?

07-30-2002, 10:34 AM
I believe the FeatureSetData InstallScript function is what you're looking for. It includes a parameter that controls the visibility of a Feature.

More info on this function can be found in the InstallShield Help Library.

07-30-2002, 10:52 AM
Nope, that one doesn't work either.

Using the following function call:

nvResult = FeatureSetData ( MEDIA , "MDAC2_7" , FEATURE_FIELD_SELECTED , TRUE , szData );

nvResult returns "0", indicating the function call was successful.

However, when I select the custom setup type to display the features, my "MDAC 2.7" (display name for feature MDAC2_7) feature is not selected.

What's going on?

07-30-2002, 11:02 AM
...and inserting the following call immediately after the FeatureSetData call:

nvResult = FeatureIsItemSelected ( MEDIA , "MDAC2_7" );

returns "1", indicating that the feature is selected. However, the feature is still not selected when viewed in the custom setup type dialog.

07-30-2002, 11:16 AM
...this doesn't work the other way either. When I enable the feature by default and turn it off by calling

nvResult = FeatureSetData ( MEDIA , "MDAC2_7" , FEATURE_FIELD_SELECTED , FALSE , szData );

the GUI displays the feature as selected even though the function returns "0" (indicating success) and subsequent calls to

nvResult = FeatureIsItemSelected ( MEDIA , "MDAC2_7" );

return "0", indicating the feature is _NOT_ selected.

07-30-2002, 12:32 PM
Evidently, the selected state of the feature as displayed when the user selects the "custom setup" type is always the default state. Changing the state to selected using FeatureSetData will not display the feature as selected in the "custom setup" type dialog. However, the feature is selected for the Typical and Compact options.

When I posted before, I was viewing the state using at run time by selecting the "custom setup" type option and the state wasn't changed (the default being unselected).

When I run the setup using the other setup types, the state is changed and the feature is installed.

I think this is a bug. If you change the state to selected programmatically, when the user selects "custom setup" at run time it should show as selected instead of the default.