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

Install component on minor upgrade if other component is installed (Basic MSI)

I am working with a Basic MSI project that contains of one feature with many components.

I would like during upgrade that my installer reselects one of these components (call it componentA) for installation if another component (lets call that component componentB) was installed in the previously installed version.

I have tried setting the re-evaluate condition to Yes for the componentA and the condition: "?componentB=3" and also tried with "$componentB=3", but it is not working as intended.

Any other suggestions are most welcome.
Labels (1)
0 Kudos
(4) Replies
Cary_R
Level 11

Hi there,

I would create a System Search that based on the component's keypath. That will get you a property that you can use in a condition.

The way you were trying is said to work (see: http://msdn.microsoft.com/en-us/library/aa368007(v=vs.85).aspx), but I wouldn't bet that it works reliably. That said, one more thing to try is something like:

$componentB=3 OR ?componentB=3

You could also create a SetProperty custom action with a similar condition that sets COMPADDLOCAL:

http://msdn.microsoft.com/en-us/library/aa367995(v=vs.85).aspx

If none of these options work, then I would post the log, since something else is going on.
0 Kudos
InstallSword
Level 3

Hi

I looked at System search and I agree it would be a good idea if I knew where the component was. The problem for me is that the user can define the path where this component is installed during installation. So I would have to search basically all local drives.

Could you please elaborate a little on what you mean by
"You could also create a SetProperty custom action with a similar condition that sets COMPADDLOCAL:"?

Thanks
0 Kudos
Cary_R
Level 11

Hi There,

The System Search will search based on where the component installs to, so this should pick up the user's selection.

Regarding the SetProperty/COMPADDLOCAL approach, you will create a SetProperty custom action with a similar condition, and set the value of the COMPADDLOCAL property to the Component Code of the component you want installed.

This marks the component for installation, as long as you sequence the SetProperty custom action before CostFinalize.

Does this make more sense?
0 Kudos
InstallSword
Level 3

Thanks for follow-up answer. Looks like I was to quick to dismiss the System Search.

Tested it now and it works as expected. Will probably go for this solution!
0 Kudos