简体   繁体   English

从WiX安装程序传递标志到合并模块?

[英]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. 当某个条件变量为true时,我们有合并模块将安装PDB文件但是我们需要设置这个条件。

Can I set this condition in the WiX installer and pass it to the merge module somehow? 我可以在WiX安装程序中设置此条件并以某种方式将其传递给合并模块吗?

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 - > AppSearch之后安排操作,以便添加此InstallExecuteSequence元素:

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

You can read more about wix custom actions here: 您可以在此处阅读有关wix自定义操作的更多信息

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. 这比在每个组件上设置条件要简单得多,并且为您是否要向最终用户显示“调试符号”功能提供了更大的灵活性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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