I see the confusion now. I am trying to use a Variable element within Bundle element.
<Bundle Name="$(var.ProductNameLong)" Version="1.1.0.0" Manufacturer="MyCo" UpgradeCode="Put-Guid-Here" IconSourceFile="some path"> <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" /> <Variable Name="SelectedFeatures" bal:Overridable="yes" /> <Variable Name="InstallMsi2" bal:Overridable="yes" Value="1"> <![CDATA[SelectedFeatures~><"FeatureA"]]> //This doesn't work in this context. I need another way to set this variable equal to 1 if SelectedFeatures contains "FeatureA". </Variable> <Chain> <MsiPackage SourceFile="MSIs\msi1.msi" Vital="yes" EnableFeatureSelection="yes" SuppressSignatureVerification="yes" Cache="no"> <MsiProperty Name="ADDLOCAL" Value="[SelectedFeatures]"/> </MsiPackage> <MsiPackage SourceFile="MSIs\msi2.msi" Vital="yes" InstallCondition="InstallMsi2=1" /> <MsiPackage SourceFile="MSIs\msi3.msi" Vital="yes" /> </Chain> </Bundle> -----Original Message----- From: John Cooper [mailto:jocoo...@jackhenry.com] Sent: Tuesday, July 1, 2014 8:28 PM To: General discussion about the WiX toolset. Subject: Re: [WiX-users] How to base MsiPackage InstallCondition on Substring of Variable Well, aside from swapping left for right in the expression (a typical problem for me). It just works, Some examples: Product.wxs <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product Id="*" Name="Substring Demo 1.0" Language="1033" Version="1.0.0.0" Manufacturer="John Merryweather Cooper" UpgradeCode="442B5A7B-0ECD-4DA7-90BB-EDCFAD345BA1"> <Package InstallerVersion="405" Compressed="yes" InstallScope="perMachine" /> <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> <MediaTemplate CabinetTemplate="sub{0}.cab" EmbedCab="yes" /> <Property Id="MsiLogging" Value="v" /> <Property Id="FEATURE_LIST" Secure="yes" Value="FeatureA;FeaturB;FeatureC;" /> <Feature Id="ProductFeature" Title="Substring Demo" Level="1"> <ComponentGroupRef Id="ProductComponents" /> </Feature> <SetProperty Id="FeatureAFound" Value="#1" After="CostFinalize" Sequence="execute"> <![CDATA[FEATURE_LIST ~>< "FeatureA"]]> </SetProperty> <SetProperty Id="FeatureBFound" Value="#1" After="CostFinalize" Sequence="execute"> <![CDATA[FEATURE_LIST ~>< "FeatureB"]]> </SetProperty> <SetProperty Id="FeatureCFound" Value="#1" After="CostFinalize" Sequence="execute"> <![CDATA[FEATURE_LIST ~>< "FEATUREC"]]> </SetProperty> <SetProperty Id="FeatureCLowerCaseFound" Value="#1" After="CostFinalize" Sequence="execute"> <![CDATA[FEATURE_LIST >< "featurec"]]> </SetProperty> <SetProperty Id="FeatureDFound" Value="#1" After="CostFinalize" Sequence="execute"> <![CDATA[FEATURE_LIST ~>< "FeatureD"]]> </SetProperty> </Product> <Fragment> <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="ProgramFilesFolder"> <Directory Id="INSTALLFOLDER" Name="SubstringDemo" /> </Directory> </Directory> </Fragment> <Fragment> <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> <Component Id="CmpSaveInstallFolder"> <RegistryKey Key="SOFTWARE\JMC\SubstringDemo" Root="HKLM"> <RegistryValue KeyPath="yes" Name="InstallLocation" Type="string" Value="[INSTALLFOLDER]" /> </RegistryKey> </Component> </ComponentGroup> </Fragment> </Wix> Extract of log for Product.wxs Action start 22:14:26: CostFinalize. MSI (s) (9C:F8) [22:14:26:303]: Doing action: SetFeatureAFound MSI (s) (9C:F8) [22:14:26:303]: Note: 1: 2205 2: 3: ActionText Action ended 22:14:26: CostFinalize. Return value 1. MSI (s) (9C:F8) [22:14:26:306]: PROPERTY CHANGE: Adding FeatureAFound property. Its value is '#1'. Action start 22:14:26: SetFeatureAFound. MSI (s) (9C:F8) [22:14:26:308]: Skipping action: SetFeatureBFound (condition is false) MSI (s) (9C:F8) [22:14:26:308]: Doing action: SetFeatureCFound MSI (s) (9C:F8) [22:14:26:308]: Note: 1: 2205 2: 3: ActionText Action ended 22:14:26: SetFeatureAFound. Return value 1. MSI (s) (9C:F8) [22:14:26:311]: PROPERTY CHANGE: Adding FeatureCFound property. Its value is '#1'. Action start 22:14:26: SetFeatureCFound. MSI (s) (9C:F8) [22:14:26:313]: Skipping action: SetFeatureCLowerCaseFound (condition is false) MSI (s) (9C:F8) [22:14:26:313]: Skipping action: SetFeatureDFound (condition is false) MSI (s) (9C:F8) [22:14:26:313]: Doing action: MigrateFeatureStates MSI (s) (9C:F8) [22:14:26:313]: Note: 1: 2205 2: 3: ActionText Action ended 22:14:26: SetFeatureCFound. Return value 1. Bundle.wxs <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> <Bundle Name="Substring Demo 1.0" Version="1.0.0.0" Manufacturer="John Merryweather Cooper" UpgradeCode="E0CDA4C5-242A-4CA4-8E88-4D412236C084"> <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" /> <Variable Name="InstallFolder" bal:Overridable="yes" Persisted="yes" /> <util:RegistrySearch Condition="Installed" Key="SOFTWARE\JMC\SubstringDemo" Root="HKLM" Value="InstallLocation" Variable="InstallFolder" /> <Variable Name="FeatureList" Persisted="yes" Value="FeatureA;FeatureB;FeatureC;" /> <Variable Name="FeatureSelect" bal:Overridable="yes" Persisted="yes" Value="FeatureA" /> <Chain> <!-- Installs FeatureA, FeatureB, or FeatureC but NOT if FeatureD --> <!-- NOTE: This would make more sense with multiple MSI's: one for each Feature and an appropriate InstallCondition --> <MsiPackage Id="SubstringDemo" SourceFile="$(var.SubstringDemo.TargetPath)" Compressed="yes" InstallCondition="FeatureList ~>< FeatureSelect"> <MsiProperty Name="INSTALLFOLDER" Value="[InstallFolder]" /> </MsiPackage> </Chain> </Bundle> </Wix> Extract of log for Bundle.wxs [1650:2F18][2014-07-01T22:13:57]i052: Condition 'FeatureList ~>< FeatureSelect' evaluates to true. -- John Merryweather Cooper Build & Install Engineer - ESA Jack Henry & Associates, Inc.(r) Shawnee Mission, KS 66227 Office: 913-341-3434 x791011 jocoo...@jackhenry.com www.jackhenry.com ________________________________________ From: Robert Harrison [robert.harri...@citrix.com] Sent: Tuesday, July 01, 2014 6:04 PM To: General discussion about the WiX toolset. Subject: Re: [WiX-users] How to base MsiPackage InstallCondition on Substring of Variable John, Your answer doesn't make sense to me. Can you check your syntax? I have tried several ways to make sense out of your response but everything I try does not build. Best, Robert -----Original Message----- From: John Cooper [mailto:jocoo...@jackhenry.com] Sent: Tuesday, July 1, 2014 3:32 PM To: General discussion about the WiX toolset. Subject: Re: [WiX-users] How to base MsiPackage InstallCondition on Substring of Variable "FeatureA" ~>< FeatureList The '~' makes the substring case insensitive. -- John Merryweather Cooper Build & Install Engineer - ESA Jack Henry & Associates, Inc.(r) Shawnee Mission, KS 66227 Office: 913-341-3434 x791011 jocoo...@jackhenry.com www.jackhenry.com -----Original Message----- From: Robert Harrison [mailto:robert.harri...@citrix.com] Sent: Tuesday, July 1, 2014 5:14 PM To: General discussion about the WiX toolset. Subject: [WiX-users] How to base MsiPackage InstallCondition on Substring of Variable To Wix-Users, I have a Burn bundle of Chained MSIs and I want to install one based on whether or not a variable contains a specific word. I have variable I am setting from the command line, ie Bundle.exe SelectedFeatures=<features-lis>. How do I set the InstallCondition attribute on the MsiPackage element to evaluate to true when <features-list> contains FeatureA? Any help will be greatly appreciated. Best, Robert ------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users NOTICE: This electronic mail message and any files transmitted with it are intended exclusively for the individual or entity to which it is addressed. The message, together with any attachment, may contain confidential and/or privileged information. Any unauthorized review, use, printing, saving, copying, disclosure or distribution is strictly prohibited. If you have received this message in error, please immediately advise the sender by reply email and delete all copies. ------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users NOTICE: This electronic mail message and any files transmitted with it are intended exclusively for the individual or entity to which it is addressed. The message, together with any attachment, may contain confidential and/or privileged information. Any unauthorized review, use, printing, saving, copying, disclosure or distribution is strictly prohibited. If you have received this message in error, please immediately advise the sender by reply email and delete all copies. ------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users