Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It is not possible to read the .wxi file from the .wixproj file. So you have to use another way to specify the version. I can give an example where I read the version from a assembly included in the installer, and use that version to rename the msi;</p> <p>Open the .wixproj file in an editor and add a <code>ReadVersion</code> target:</p> <pre><code> &lt;Target Name="ReadVersion"&gt; &lt;GetAssemblyIdentity AssemblyFiles="bin\program.exe"&gt; &lt;Output TaskParameter="Assemblies" ItemName="MyAssemblyIdentities" /&gt; &lt;/GetAssemblyIdentity&gt; &lt;Message Text="AssemblyVersion = %(MyAssemblyIdentities.Version)" /&gt; &lt;CreateProperty Value="$(TargetName) %(MyAssemblyIdentities.Version)"&gt; &lt;Output TaskParameter="Value" PropertyName="TargetName" /&gt; &lt;/CreateProperty&gt; &lt;CreateProperty Value="$(TargetName)$(TargetExt)"&gt; &lt;Output TaskParameter="Value" PropertyName="TargetFileName" /&gt; &lt;/CreateProperty&gt; &lt;CreateProperty Value="$(OutDir)$(TargetFileName)"&gt; &lt;Output TaskParameter="Value" PropertyName="TargetPath" /&gt; &lt;/CreateProperty&gt; &lt;/Target&gt; </code></pre> <p>This reads the version from <code>bin\program.exe</code>, displays it for debugging purposes, and changes the TargetName, TargetFileName and TargetPath.</p> <p>After the line containing <code>&lt;Import Project="$(WixTargetsPath)" /&gt;</code>, add the following to inject this target into the build process:</p> <pre><code> &lt;PropertyGroup&gt; &lt;BuildDependsOn&gt;ReadVersion;$(BuildDependsOn)&lt;/BuildDependsOn&gt; &lt;/PropertyGroup&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

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