I inherited a complex InstallScript project originally written in InstallShield 11 and upgraded to InstallShield 2009. The project makes use of script created features. If the software associated with a subfeature has already been installed, the customer wants to show the subfeature as selected and disabled.
The original developer was able to make this work by using an undocumented feature of FeatureSetData:
#define TREE_ITEM_ENABLED_SELECTED_STR "8192"
#define TREE_ITEM_ENABLED_DESELECTED_STR "4098"
// The following is the sum of the previous two defines.
#define TREE_ITEM_DISABLED_SELECTED_STR "12290"
The command:
nResult = FeatureSetData(MEDIA, szFeatureName, FEATURE_FIELD_FTPLOCATION, 0, TREE_ITEM_DISABLED_SELECTED_STR);
Sets the feature to be selected and disabled. Unfortunately, this doesn't entirely work in InstallShield 2009. Instead of just that feature being selected and disabled, it sets all features to be selected, that feature to be disabled and you can't deselect anything.
Does anyone know of a method to disable a feature item in the treeview? Or, set a script created feature to be required? Or some other method that will allow me to handle this requirement?
Thanks in advance.
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Disabling script created features
Started by
wijo
, Apr 21 2009 20:17
2 replies to this topic
Posted 22 April 2009 - 12:00
If feature A is set as a required feature in feature B's properties, and feature B is selected, then feature A should also be selected and disabled. In addition you can make feature B invisible if needed. This should work for "real" features, not sure about script created features.
Stefan Krüger
InstallSite.org twitter facebook
Posted 23 April 2009 - 18:46
Yeah, it's the script created components that throw the wrench into the whole thing. The main problem we have is that we're trying to use InstallShield to as if it were a general purpose language instead of what it is. There are lots of tricks and hacks that were used to make it functional, but they aren't aging very well.
Thanks, Stefan. I think we're just going to leave features like this out. It's not an ideal situation, but it works more or less.
Thanks, Stefan. I think we're just going to leave features like this out. It's not an ideal situation, but it works more or less.