Howto use configurable Merge Modules in Wix?
Asked Answered
P

3

6

AFAIK it's done like this:

Product:

<Merge Id ="HelpInstaller" SourceFile="HelpInstaller.msm" Language="1033" DiskId="1">
                <ConfigurationData Name="SurpressInstallation_Config" Value="&amp;HelpFeature"/>
 </Merge>

Merge Module:

<Property Id="SupressInstallation" Value='0'  />

<Substitution Table='CustomAction' Row='SetSupressInstallationProperty' Column='Target' Value='[=SupressInstallation_Config]'/>
<CustomAction Id='SetSupressInstallationProperty' Property='SupressInstallation'      Value='[SupressInstallation]'/>  
<InstallExecuteSequence>
  <Custom Action='SetSupressInstallationProperty' Before='RegisterHelp' />
  <Custom Action='RegisterHelp' After='CostFinalize'>(NOT Installed) AND (NOT UPGRADINGPRODUCTCODE) AND SupressInstallation = 3) </Custom>
</InstallExecuteSequence>

But when i did it like above i get an error: Encountered an unexpected merge error of type 'msmErrorDataRequestFailed' for which therer is currently no error messagte to display.

Can anyone tell me howto solve that problem? What i basically want to do is to execute a custom action in the merge module only when a certain feature is selected..Is this the right way to do it? Thanks Daniel

Panto answered 19/1, 2010 at 7:8 Comment(0)
S
5

You have to define Configuration node under module:

<Property Id="SupressInstallation" Value='0'  />
<Configuration Name="SupressInstallation_Config" Format="Text"/>
<Substitution Table='CustomAction' Row='SetSupressInstallationProperty' Column='Target' Value='[=SupressInstallation_Config]'/>
<CustomAction Id='SetSupressInstallationProperty' Property='SupressInstallation'      Value='[SupressInstallation]'/>  
<InstallExecuteSequence>
  <Custom Action='SetSupressInstallationProperty' Before='RegisterHelp' />
  <Custom Action='RegisterHelp' After='CostFinalize'>(NOT Installed) AND (NOT UPGRADINGPRODUCTCODE) AND SupressInstallation = 3) </Custom>
</InstallExecuteSequence>
Sufism answered 7/12, 2012 at 11:33 Comment(0)
U
1

That sounds like a bug. You should at least get a more descriptive error message explaining what went wrong. Feel free to file the bug at http://wixtoolset.org/bugs

Unscratched answered 20/2, 2012 at 20:51 Comment(0)
T
0

A feature has a dependency on a merge module, not the other way around. Nothing in the merge module should have a reference to anything outside of the merge module such as a ProductName, ProductCode or Feature name because that would tightly couple the merge module to a specific product rather then being a generic reusable module. Doing such would essentially create a circular reference and is not idea.

What you probably need ( hard to say without knowing more information ) is to use the action state of one of the Components in the merge module for your condition.

For example if component1 has file1 and you need customaction1 to fire when this component/file is being installed then you'd use an expression of:

$component1=3 //INSTALLSTATE_LOCAL

That way if this merge module gets merged into Product1, Product 2 or Product3 with Feature Name A, B or C it won't matter because the association is at the component level.

If the feature you are trying to tie off of is a different feature then this all needs to be moved into a different merge module that get's merged into that feature. You might need to create a dummy component to associate to.

Now if you want to ignore all of this advice, then look at the Feature Action state operator and tightly couple away.

Conditional Statement Syntax

Tympany answered 14/12, 2011 at 15:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.