cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
guyjoules
Level 4

Removing Features on Build Time

guys, please help -

I have an installer, InstallScript project, which have 30 features.
I want to build from command line, but I want to remove some features from the project. What is the best way to do that?

Is there a way to assign build directive to a feature, and pass to the build command line which build directive to include (like #ifdef)??

I want to do that, because I want the setup.exe file to be as small as possible.

Thank you very much,
Guy Catz.
Labels (1)
0 Kudos

(5) Replies
MichaelU
Level 12 Flexeran
Level 12 Flexeran

It sounds like you are looking for "Release Flags" - the help has more information about how you could use them for exactly this purpose.
0 Kudos
guyjoules
Level 4

Hi Michael.

Thank you for your reply.
The problem is that release flags are not available in InstallScript projects.

The closest thing I found is using the Features field in the Release view. This way I can choose which features to include in a specific release.

The problem is that this must be static and I need it to be dynamic, i.e. I want to be able to choose these features from command-line, as I don't know which features to include in design time.

Thanks..
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

Hi Guy, sorry for the misleading response. I missed the InstallScript part (and even forgot it didn't have Release Flags). There is a workaround available if you can script up some automation layer code, however: the ISWiFeature object has a property IncludeInBuild which you could use to turn the feature on and off. Then save and build, and move on to setting up the next configuration you need. It's certainly not as convenient as release flags would be, but it might be a workable direction for you to go.
0 Kudos
guyjoules
Level 4

Michael, thank you very much.

Is there a sample code I can use?
Also, can this be done using a DOS batch file?

Thank a lot!!
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

There should be samples in our documentation and KB, not to mention littered throughout the community. The short overview specific to your needs though is once you have your ISWiProject instance, get the ISWiFeatures collection from it, iterate it by name, index, or loop, to get the ISWiFeature objects on which you set the IncludeInBuild I mentioned last post. If nothing else, the topic on ISWiProject has half a snippet on creating the object. This is commonly done from VBS (VB Script) files, and those can easily be called from a batch file, but I don't believe can be easily embedded.
0 Kudos