Note that there are some explanatory texts on larger screens.

plurals
  1. POWix: Passing Dialogue Control Values to Configurable Merge Modules
    text
    copied!<p>I'm having trouble accomplishing a task with the Wix Toolset. In particular, I have a scenario where I have an MSI that configures an MSM (Configurable Module). The MSI has a custom UI dialogue from which user input is to be used to configure the MSM.</p> <p>When I try to configure the MSM using a hardcoded value for the address property as shown below it works fine and the MSM is configured correctly. (I believe this configuration happens and build-time as opposed to run-time - the issue may lay there.).</p> <p>The problem occurs when I use a custom dialogue to set the value of the address property at installation time (i.e run-time). The configurable module still uses the hardcoded value, rather than the users input. Is the problem because merge module configuration is done during build-time only. Is there a way to pass a value to the merge module from the UI of the main MSI?</p> <p>Here is an over simplified version:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"&gt; &lt;Product Id="cf1d176d-2d57-435e-8e7f-abba14de821c" Language="1033"&gt; &lt;Media Id="1" Cabinet="SemanticEvolution.cab" EmbedCab="yes" /&gt; &lt;Property Id="Address" Value="http://127.0.0.1" /&gt; &lt;Directory Id="TARGETDIR" Name="SourceDir"&gt; &lt;Directory Id="ProgramFilesFolder"&gt; &lt;Directory Id="INSTALLLOCATION" Name="Semantic Evolution"&gt; &lt;Merge Id="MergeModule" Language="1033" SourceFile="Module.msm" DiskId="1"&gt; &lt;ConfigurationData Name="EndpointAddressConfiguration" Value="[Address]" /&gt; &lt;/Merge&gt; &lt;/Directory&gt; &lt;/Directory&gt; &lt;/Directory&gt; &lt;Feature Id="SemanticEvolutionFeatures" Title="Semnatic Evolution" Level="1"&gt; &lt;Feature Id="TestFeature" Title="TestFeature" Level="1"&gt; &lt;MergeRef Id="MergeModule" /&gt; &lt;/Feature&gt; &lt;/Feature&gt; &lt;UI Id="CustomWixUI"&gt; &lt;UIRef Id="WixUI_FeatureTree" /&gt; &lt;DialogRef Id="ConfigurationDlg" /&gt; &lt;Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="ConfigurationDlg"&gt;LicenseAccepted = "1"&lt;/Publish&gt; &lt;Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="ConfigurationDlg"&gt;NOT Installed&lt;/Publish&gt; &lt;/UI&gt; &lt;/Product&gt; &lt;/Wix&gt; </code></pre> <p>Here is a snipet of the merge module:</p> <pre><code>&lt;Configuration Name="EndpointAddressConfiguration" Format="Text" /&gt; &lt;Substitution Table="CustomAction" Row="SetEndpointAddress" Column="Target" Value="[=EndpointAddressConfiguration]" /&gt; &lt;CustomAction Id="SetEndpointAddress" Property="EndpointAddress" Value="[EndpointAddress]" /&gt; &lt;InstallExecuteSequence&gt; &lt;Custom Action="SetEndpointAddress" Before="LaunchConditions"&gt;1&lt;/Custom&gt; &lt;/InstallExecuteSequence&gt; </code></pre> <p>Eventually in the merge module the configured property is used as follows:</p> <pre><code>&lt;util:XmlFile Id="EndpointAddress" Action="setValue" ElementPath="/configuration/system.serviceModel/client/endpoint/@address" File="[#Se.Gui.exe.config]" Value="[EndpointAddress]/ApiDataService"/&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload