cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dave101
Level 3

Filtering Components in an InstallScript (non-MSI) Project

Is there any sample code on how to implement an OnFilterComponents override - to filter on something other than on OS or Language -- in an InstallScript project (non-MSI)?

The doco seems to suggest moving to separate Features instead of Components. Unfortunately, the Feature level is also the level at which the user selects what is to be installed, and the goal here is to manage installation of components at a level below that where the end-user sees this.

Basically, we're building an install in which the entry of a key code and other custom UI selections are made that result in which components are installed. The app also includes thousands of files, so it would be best if the dynamic component creation feature is used, to avoid having thousands of lines of code hardcoded in the InstallScript.

Perhaps there is a feature-based solution that would work, if implemented correctly.
Labels (1)
0 Kudos
(4) Replies
RobertDickau
Flexera Alumni

If nothing else, could you introduce a layer of hidden features (with Visible set to No) between the user-selectable features and the components, and then conditionally select and deselect those invisible features?
0 Kudos
dave101
Level 3

Yes, Thanks. That might work.

Is there an example of how to filter on a feature/subfeature in a non-MSI InstallScript project? Sadly, a search on this returns many hits on how to accomplish this in an MSI project, but little on how to do it in InstallScript.

I see that there are feature-specific function overrides ("FeatureName_Installing", etc), but what statements would go inside such a function? What variable should be set or method called inside the function override to tell the engine to not install the feature?

Or, is there some other way of coding this in an InstallScript?

How, in an InstallScript, do you code something like this:

if (varA = 1)
do-not-install-this-feature (or feature A)?
0 Kudos
RobertDickau
Flexera Alumni

I think FeatureSelectItem is the InstallScript function you want. (The help topic for that function describes how to refer to subfeatures in your code.)
0 Kudos
dave101
Level 3

Thanks. It looks like that will work.

The topic on FeatureSelectItem in the InstallScript Guide even has a sample.
0 Kudos