In your MSI you might want to look at the 'remember property' pattern.  I
have found these posts helpful:
http://www.nichesoftware.co.nz/node/633
http://robmensching.com/blog/posts/2010/5/2/the-wix-toolsets-remember-property-pattern

I use the above pattern for properties which are passed to MSI packages,
which may be needed at a later time even.  The MSI package may get launched
without the bundle, such as via a 'repair' of an advertised feature.

In the bundle if the property is implemented as a 'remember property
pattern' in the MSI then I define a variable in the bundle like this: (note
that the type is a string, to be used with MsiProperty, and
Variable/@Persisted='yes' is not used, since the remember property pattern
will be used):

<Variable Name='MyStringVariable' Value='*' Type='string'
bal:Overridable='yes'/>

For variables which I do not need to be passeed into a MSI, but are use to
control whether a MsiPackage is installed, I define the variable like this
(note the numeric type and the persisted attribute):
<Variable Name='MyNumericVariable' Value='1' Type='numeric'
bal:Overridable='yes' Persisted='yes'/>

Whether I am using the WixStdBA or my custom mba, I implement the logic
necessary to set either the string variable or the numeric variable in the
ba (using a bafunctions.dll) or mba.  There are examples of using either a
bafunctions.dll (with WixStdBA) or a mba in the wix toolset source.

Then in the Bundle/@MsiPackage the MsiPackage/@InstallCondition looks like
this:
InstallCondition='MyNumericVariable = 1'

The MsiPackage/@MsiProperty looks like this"
<MsiProperty Name='MY_REMEMBERED_PROPERTY' Value='[MyStringVariable]'/>

I have a lot yet to learn, but this the approach that is working for me.




--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Set-property-on-condition-in-MSI-tp7594095p7594099.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to