cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Pilgrim

Conditionally installing a component based on whether a feature is installed.

I have a very important question that I need answered as quickly as possible.

I have a component (let's say Component1) that needs to be installed for FeatureA, but ONLY if FeatureB is not installed, because FeatureB will need to overwrite and register Component1 in a different area if it's chosen.

Does InstallShield allow for this, or do I have to create two separate installers instead? I found this thread: http://community.installshield.com/showthread.php?t=74982&highlight=conditionally+installing+compone... and it seems to state that I'll need to create a DoActionControlEvent, however, since the Custom Setup dialog box in IS 2008 doesn't describe each member of the Feature Tree, I'm unsure precisely what to put in the Event Table columns in order to make this work.

Some clear, concise examples, perhaps just using the pseudonyms above, would help (or some other way of doing it would also help if there is one). Anything you can tell me is much appreciated...
Labels (1)
0 Kudos
5 Replies
Pilgrim

Re: Conditionally installing a component based on whether a feature is installed.

Anybody able to throw me a quick example of how to do this? Could really use some help and this is time-sensitive.
0 Kudos
Pilgrim

Re: Conditionally installing a component based on whether a feature is installed.

try to add condition to a component

&FeatureB=2


did u think to use INSTALLLEVEL property ?
0 Kudos
Pilgrim

Re: Conditionally installing a component based on whether a feature is installed.

I tried this already - In order to test this functionality I've created some random sample code in IS 2008 Pro -

The sample code Feature List looks like this:

Feat1 -> Installs Batman.txt
Feat2 -> Installs Catwoman.txt
Sub1 -> Installs Joker.txt, and is set to InstallLevel2
Sub2 -> Installs TwoFace.txt and is set to InstallLevel2

Both Sub1 and Sub2 features have a condition -
InstallLevel Condition
1 &Feat1>=2

I then run the program - no matter what I do, Joker and TwoFace are installed on the machine. The link I posted earlier said that conditions are evaluated during costing, not during CustomSetup, so I don't think I can use normal Conditions for this. Does anyone have any ideas?

(Of note, obviously the topic of this thread is conditionally installing a component, not a subfeature, but I read somewhere a few minutes ago that features would be easier to evaluate than components so I changed it to a subfeature - but if changing it back to a component will make a difference, let me know.)
0 Kudos
Pilgrim

Re: Conditionally installing a component based on whether a feature is installed.

Maybe this will help?


http://www.joyofsetup.com/tag/windows-installer/

see:Feature states in component conditions
0 Kudos
Pilgrim

Re: Conditionally installing a component based on whether a feature is installed.

He only talks there about how the documentation is not complete, he doesn't give any concrete examples of how to do this. I have sent him a question asking if he knows any examples off the top of his head, but I don't know if he'll answer.
0 Kudos