Note that there are some explanatory texts on larger screens.

plurals
  1. POInclude MajorVersion etc in filename (OutputName) when building MSI file (wix project)
    text
    copied!<p>In my Defines.wxi I have:</p> <pre><code>&lt;?define MajorVersion="1" ?&gt; &lt;?define MinorVersion="08" ?&gt; &lt;?define BuildVersion="11" ?&gt; </code></pre> <p>In my MyProject.Setup.wixproj I have:</p> <pre><code>&lt;OutputName&gt;MyProject&lt;/OutputName&gt; &lt;OutputType&gt;Package&lt;/OutputType&gt; </code></pre> <p>Is it possible to include the version variables in the filename somehow, so that my file can be named MyProject.1.08.11.msi?</p> <p>This didn't work (no such variable is defined): </p> <pre><code>&lt;OutputName&gt;MyProject-$(MajorVersion)&lt;/OutputName&gt; &lt;OutputType&gt;Package&lt;/OutputType&gt; </code></pre> <p>This didn't work (no such variable is defined):</p> <pre><code>&lt;Target Name="AfterBuild" Condition="'$(Configuration)' == 'Release'"&gt; &lt;Copy SourceFiles="$(OutputPath)$(OutputName).msi" DestinationFiles="C:\$(OutputName)-$(MajorVersion).msi" /&gt; &lt;/Target&gt; </code></pre> <p>It seems very clear to me that $(MajorVersion) is not the correct way of fetching the definition from the Defines.wxi file. What is?</p> <hr> <p><strong>Update</strong></p> <p>I tried to put this in MyProject.Setup.wixproj:</p> <pre><code>&lt;InstallerMajorVersion&gt;7&lt;/InstallerMajorVersion&gt; &lt;InstallerMinorVersion&gt;7&lt;/InstallerMinorVersion&gt; &lt;InstallerBuildNumber&gt;7&lt;/InstallerBuildNumber&gt; </code></pre> <p>...</p> <pre><code>&lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "&gt; &lt;OutputPath&gt;bin\$(Configuration)\&lt;/OutputPath&gt; &lt;IntermediateOutputPath&gt;obj\$(Configuration)\&lt;/IntermediateOutputPath&gt; &lt;DefineConstants&gt;PrebuildPath=..\..\obj\prebuild\web\;InstallerMajorVersion=$(InstallerMajorVersion);InstallerMinorVersion=$(InstallerMinorVersion);InstallerBuildNumber=$(InstallerBuildNumber)&lt;/DefineConstants&gt; &lt;/PropertyGroup&gt; </code></pre> <p>And this in Defines.wxi:</p> <pre><code>&lt;?define MajorVersion="$(var.InstallerMajorVersion)" ?&gt; &lt;?define MinorVersion="$(var.InstallerMinorVersion)" ?&gt; &lt;?define BuildVersion="$(var.InstallerBuildNumber)" ?&gt; &lt;?define Revision="0" ?&gt; &lt;?define VersionNumber="$(var.InstallerMajorVersion).$(var.InstallerMinorVersion).$(var.InstallerBuildNumber)" ?&gt; </code></pre> <p>Didn't work either. Got these error messages:</p> <ul> <li>The Product/@Version attribute's value, '..', is not a valid version. Legal version values should look like 'x.x.x.x' where x is an integer from 0 to 65534.</li> <li>The Product/@Version attribute was not found; it is required.</li> </ul>
 

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