简体   繁体   中英

Pass flag to merge module from WiX installer?

We have merge modules that will install PDB files when a certain conditional variable is true however we need this condition to be set.

Can I set this condition in the WiX installer and pass it to the merge module somehow?

You can set installer properties in merge modules by using this format:

<property_name>.<module_GUID>

For example:

CONDITION_PROPERTY.32D73316_E513_43C3_99F5_381A4B5F0A78

In your installer you can try using a custom action to set the property used in the merge module condition.

The custom action element can look like this:

<CustomAction Id="SetMsmProperty" Return="check" Property="CONDITION_PROPERTY.32D73316_E513_43C3_99F5_381A4B5F0A78" Value="myValue" />

You can schedule the action after InstallExecuteSequence -> AppSearch, so you can add this InstallExecuteSequence element:

<InstallExecuteSequence>
  <Custom Action="SetMsmProperty" After="AppSearch">NOT Installed</Custom>
</InstallExecuteSequence>

You can read more about wix custom actions here:

I just typically create a subfeature to create a variation point in the installer. You can then put a feature condition on it to control whether the components brought in by the merge modules get installed or not. This is a lot simpler then putting a condition on each component and gives you more flexibility of whether you want to show the "debug symbols" feature to the end user or not.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM