While creating a reconfigurable merge module project in Wix 3.0.4513.0
Create a new property element with the suppressmodularization attribute:
<property id="user-content-SomeProperty" value="1" suppressmodularization="yes"></property>
Create a Substitution entry to reconfigure this property value:
<substitution table="Property" row="SomeProperty" column="Value" value="<span>[=Property_Retargetable]</span>"></substitution>
Build the mergemodule (candle + light).
Open the mergemodule in ORCA. Notice in the ModuleSubstition table, the Row has the modularization applied:
SomeProperty.MODULE_ID
This prevents the reconfigurable mergemodule from configuring properly.
Don't do that. Suppress modularization is designed to be used for some very special cases around passing data to CustomActions. Property ids should be modularized.
Hi Robert.
I am using the suppressmodularization for mergemodules containing a CustomAction (and only a custom action). The CustomAction behavior is configured by reconfigurable properties, which is set by the developer whom consumes the MergeModule in their host setup project.
The problem is that I need two different ModuleID for two identical MergeModules - identical except for company name resource ID that tags the custom action binary (long story, but our company is named different in Japan).
I am working around this problem by creating a separate "ModuleID" property set by a WiX preprocessor. But becase the custom action depends reads the property table, this fails because it only knows about one ModuleID.
Unfortunately the binary is not rebuilt - its remarked using a resource editor (Restorator) - so I can't take advantage of using a compiler flag when the binary is built.
Currently, I found a workaround - I can use the suppressmodularization flag on a property that is not reconfigurable. I set this property the ModuleID in the MergeModule project. Then the custom action DLL reads this property, and assembles the "true" property string.
But this seems like it would be better to suppressmodularization, except I can't use reconfigurable settings.
Any other ideas?
You have a number of options. You could use the same ModuleId for the Merge Modules. Or you could teach the CustomAction to look for both Property values. Or you could build/restorate the CustomAction twice to understand which ModuleId it is looking around.
Fundamentally, modularization suppression is designed for only a couple narrow scenarios where there are no other workarounds due to limitations in the Windows Installer design. A wide search for all uses of a suppressed Property is not done by the linker because it is expensive and very difficult to do perfectly.
In general, it is best to avoid the suppression.