cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dmetzler
Level 6

installation feature selection, part 2

Okay - I am revisiting this, with more details.

First, the installer was to be created for command line use with msiexec and passing parameters:

VISTAGADGET=1
DESKTOPICON=1

When run with the command line, the above flags work correctly as there are features which are associated with components for the VistaGadget and DesktopIcon.

The components have conditions as follows:
VistaGadget condition: VersionNT=600 And WindowsBuild>=5600 and VISTAGADGET=1
DesktopIcon condition: DESKTOPICON=1

However, I also want to enable feature selection if the installer is run with the UI. Since the features related to the components, is there a way to have a selected feature set the above parameters appropriately? So if the user selects the "Vista Gadget" feature, I want the VISTAGADGET=1 parameter to be set so that the component gets installed correctly.

Thanks in advance,

Don Metzler
Labels (1)
0 Kudos
(5) Replies
Kelter
Level 10

So i take it you've assigned the condition "VISTAGADGET=1" to the component under the vistagaget feature. I'd recommend that you instead use feature conditions. for example, lets say that the installevel for VistaGadget feature is 100. Set up two feature conditions as follows:
Level    Condition
----- ---------
1 VISTAGADGET=1
200 VISTAGADGET!=1

you could also use a control event on the "next" button of the "custom setup" dialog as follows:[CODE]Event Argument Condition
------------- -------- -----------------------------------------------------------
[VISTAGADGET] 1 &VistaGadget=3 OR (!VistaGaget=3 AND &Vistagaget<>2)
[VISTAGADGET] 0 NOT( &VistaGadget=3 OR (!VistaGaget=3 AND &Vistagaget<>2) )[/CODE]
Where vistaGadget is the name of the feature containing the Vistagadget component.
0 Kudos
dmetzler
Level 6

Kelter wrote:
So i take it you've assigned the condition "VISTAGADGET=1" to the component under the vistagaget feature. I'd recommend that you instead use feature conditions. for example, lets say that the installevel for VistaGadget feature is 100. Set up two feature conditions as follows:
Level    Condition
----- ---------
1 VISTAGADGET=1
200 VISTAGADGET!=1

you could also use a control event on the "next" button of the "custom setup" dialog as follows:[CODE]Event Argument Condition
------------- -------- -----------------------------------------------------------
[VISTAGADGET] 1 &VistaGadget=3 OR (!VistaGaget=3 AND &Vistagaget<>2)
[VISTAGADGET] 0 NOT( &VistaGadget=3 OR (!VistaGaget=3 AND &Vistagaget<>2) )[/CODE]
Where vistaGadget is the name of the feature containing the Vistagadget component.


I think I understand what you have presented here. I will look at this.

Do you know if there is a property set internally to determine if the .msi is run via command line or UI?

Thanks,

Don
0 Kudos
Kelter
Level 10

Look into the UILEVEL Property. That will determine the level of UI which will help you as long as "command line" means silent install. Otherwise look for the existence of properties that would be set by the command line (suggest initializing said properties to bogus values)
0 Kudos
dmetzler
Level 6

Kelter wrote:
Look into the UILEVEL Property. That will determine the level of UI which will help you as long as "command line" means silent install. Otherwise look for the existence of properties that would be set by the command line (suggest initializing said properties to bogus values)


Thanks. I will look at this as well.

Don
0 Kudos
Kelter
Level 10

Just to elaborate a bit on what I had mentioned previously...
Level    Condition
----- ---------
1 VISTAGADGET=1
200 VISTAGADGET!=1
Just to clarify, if VISTAGADGET=1 then the installlevel of that feature will be set to 1 and provided that the installlevel property is greater than 1, it will be included; or in the customsetup dialog, the feature will be initialized to be installed ("local" = 3). If VISTAGADGET!=1 then the installlevel of the feature will be set to 200, which would be higher than the default installlevel property, and would therefore not be included in a silent intall, or would be initialized as "Do not install" ("absent" = 2) on the custom Setup dialog.

[CODE]Event Argument Condition
------------- -------- -----------------------------------------------------------
[VISTAGADGET] 1 &VistaGadget=3 OR (!VistaGaget=3 AND &Vistagaget<>2)
[VISTAGADGET] 0 NOT( &VistaGadget=3 OR (!VistaGaget=3 AND &Vistagaget<>2) )[/CODE]This stuff here is indended to set the property upon which the install state of the VistaGadget component's condition depends. Now you may be asking yourself, "WTF would you do that if a component without a condition will always be installed when it's parent component is to be installed?" And to you i'd say, that's a good question...and a reason why you should just stick with the feature conditions, and remove the condition from the component; however if you were to leave that condition there, then on a silent install, the feature would be enabled by default, and the component would be enabled or disabled by the property set on the cmd line.

The moral of the story is to stick with feature conditions. Only use component conditions when components within a feature depend on something other than whether or not the entire feature should be installed.

Refer to the help topic on Conditional Statement Syntax for details on the Feature Actions (&Featurename) and Feature States(!FeatureName), and the meanings of their enumerated values. Of course, you won't need that info for this particular problem since you're not going to need to set a value for a property upon which a component state depends since the component's state should depend only upon the state of its parent feature...which is the default behavior anyways. That's just my interpretation of the limited description of the problem at hand, but give it some thought, and feel free to challenge my assumptions. 🙂 I did try to make my assumptions known so that you'd know upon what my solutions were based.

Good luck!
0 Kudos