Note that there are some explanatory texts on larger screens.

plurals
  1. POReferencing a WixVariable defined in a WiX Library Project from a WiX Setup Project
    text
    copied!<p>I'm trying to configure a WiX setup and library so that the version of one of the files in the library is used as the Product/@Version in the setup.</p> <p><strong>Background</strong></p> <p>In a setup with the files defined locally this is relatively straightforward in that assuming the component project is referenced by the WiX project and then configured:</p> <pre><code> &lt;Component Id="Company.Assembly" Guid="[GUID]"&gt; &lt;File Id="Company.AssemblyFile" Name="Company.Assembly.dll" KeyPath="yes" DiskId="1" Source="$(var.Company.Assembly.TargetPath)" /&gt; &lt;/Component&gt; </code></pre> <p>Then the product version can be set as</p> <pre><code> &lt;Product Id="[GUID]" Name="Product Name" Language="1033" Version="!(bind.FileVersion.$(var.Company.AssemblyFile .TargetFileName))" Manufacturer="Company Name" UpgradeCode="[GUID]"&gt; </code></pre> <p><strong>Issue</strong></p> <p>So having moved all the components to a WiX Library project it's no longer possible to directly reference the <code>!(bind.FileVersion.$(var.Company.AssemblyFile.TargetFileName))</code> variable.</p> <p>I've tried configuring a WixVariable in the library</p> <pre><code>WixVariable Id="BuildVersion" Value="!(bind.FileVersion.Company.AssemblyFile)"/&gt; </code></pre> <p>And then reference that from the setup</p> <pre><code> &lt;Product Id="[GUID]" Name="Product Name" Language="1033" Version="!(wix.BuildVersion)" Manufacturer="Company Name" UpgradeCode="[GUID]"&gt; </code></pre> <p>Without success.</p> <p>Is there some additional step or syntax required in either the library or setup to make the WixVariable (or some derivation of it) accessible from the setup?</p>
 

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