This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Technique question: put component into multiple features, or create common feature?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 12, 2014
02:52 PM
Technique question: put component into multiple features, or create common feature?
There have been many times in which a certain component in my project is needed in more than one feature (usually because the different features get built with different products). When such a case arises I've avoided putting the component in multiple features. Instead, I create a single "common" feature that has release flags to indicate it will get built with multiple products, and I put the component in that feature. I've always been opposed to putting components into more than one feature, thinking that it is cleaner to create common features instead. But even this approach can get messy. Is one technique better than the other? Is there a "best practices" way of handling this situation?
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 12, 2014
03:21 PM
I am aware of one caveat that will bite you, and it is subtle.
It has to do with multi-feature membership of the built *.msi package.
If you use release flags to include a component into features that are mutually exclusive across your builds, you are probably OK. However, this situation is what you have to watch out for:
[LIST=1]
Component A belongs to multiple features (feature A and feature B)
User selects custom install, selects both Feature A and Feature B
User changes mind and deselects Feature B
Component now doesn't get installed, even though it belongs to Feature A, which is getting installed.
What is happening here is that the SelectionTree dialog performs a "Select" operation that toggles components underneath each of the features. Since the last operation in the above example is a "Toggle Off" for all components under Feature B, you end up losing Component A.
This is a strong case for a Common feature that you just put some conditions on. If certain builds need to not install the Common Feature, then put a condition on that feature that checks against the ISReleaseFlags property for certain release flags:
http://helpnet.installshield.com/installshield16helplib/IHelpCustomActionsReleaseFlags.htm
You can also do this on a Component level. Of course, once you start getting into multiple features with different destinations, at a certain point it starts to make sense to just use the DuplicateFile table, or multiple components, etc.
It has to do with multi-feature membership of the built *.msi package.
If you use release flags to include a component into features that are mutually exclusive across your builds, you are probably OK. However, this situation is what you have to watch out for:
[LIST=1]
What is happening here is that the SelectionTree dialog performs a "Select" operation that toggles components underneath each of the features. Since the last operation in the above example is a "Toggle Off" for all components under Feature B, you end up losing Component A.
This is a strong case for a Common feature that you just put some conditions on. If certain builds need to not install the Common Feature, then put a condition on that feature that checks against the ISReleaseFlags property for certain release flags:
http://helpnet.installshield.com/installshield16helplib/IHelpCustomActionsReleaseFlags.htm
You can also do this on a Component level. Of course, once you start getting into multiple features with different destinations, at a certain point it starts to make sense to just use the DuplicateFile table, or multiple components, etc.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 12, 2014
03:32 PM
That's a pretty nasty gotcha. Thanks for the info, I'll stick with using Common features.
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)