Automotive Number Using WIX

I am using the WIX tool to create the installation file for our project.

I want to have a dynamic (incremental) build number. So can someone guide me.

Please do not offer a solution, for example 1.0.0. *, as this gives any dynamic number at the end. I want it to be incremental, like 1.0.0.1, 1.0.0.2, 1.0.0.3, .....

+3
source share
2 answers

You cannot do this using WiX natively.

However, you can define your version as a variable. eg:.

<Product Id="*"
         UpgradeCode="$(var.Property_UpgradeCode)"
         Name="!(loc.ApplicationName)"
         Language="!(loc.Property_ProductLanguage)"
         Version="$(var.version)"
         Manufacturer="!(loc.ManufacturerName)" >

You can then pass the version number on the command line. Here is an example of using Nant

<candle
          out="${dir.obj}\"
          rebuild="true"
          extensions="WixUIExtension;WixNetFxExtension">
            <defines>
                <define name="ProcessorArchitecture" value="${release.platform}" />
                <define name="SourceDir" value="${dir.source}" />
                <define name="version" value="${version}" />
                <define name="releasetype" value="${release.type}" />
                <define name="Language" value="${language}" />
            </defines>

            <sources>
                <include name="*.wxs" />
            </sources>
        </candle>

, :)

+1

msbuild ,

<PropertyGroup>

    <MinorIncrement Condition=" '$(ReleaseType)' == 'Internal' ">None</MinorIncrement>
    <MinorIncrement Condition=" '$(MinorIncrement)' == '' ">Increment</MinorIncrement>
    <BuildIncrement>Increment</BuildIncrement>
    <BuildIncrement Condition=" '$(MinorIncrement)' == 'Increment' ">Reset</BuildIncrement>
</PropertyGroup>

<Target Name="BumpVersion">
    <Version VersionFile="version.txt" MinorType="$(MinorIncrement)" BuildType="$(BuildIncrement)">
        <Output TaskParameter="Major" PropertyName="Major"/>
        <Output TaskParameter="Minor" PropertyName="Minor"/>
        <Output TaskParameter="Build" PropertyName="Build"/>
        <Output TaskParameter="Revision" PropertyName="Revision"/>
    </Version>

    <AssemblyInfo CodeLanguage="CS" OutputFile="VersionInfo.cs" AssemblyVersion="$(Major).$(Minor).$(Build).$(Revision)" AssemblyFileVersion="$(Major).$(Minor).$(Build).$(Revision)"/>
    <Message Text="Version: $(Major).$(Minor).$(Build).$(Revision)"/>
</Target>

. , , , .

CruisControl.Net ReleaseType.

ReleaseType "Internal", , , , reset .

Version .txt "1.0.1.3", - , , , ( !) ,

+1

Source: https://habr.com/ru/post/1750984/


All Articles