[wix-users] Incremental builds

Tom Brezinski tom.brezinski at ViaviSolutions.com
Mon Nov 7 04:37:32 PST 2016


I will throw out what I do though I am not sure if it will be of help.  I have a WiX include file which defines variables for version and product code.  When my CI build runs it uses a small python script to update the version in the file and set the product code to '*'.  My CI builds always have a minor version of 210 and a build version which is the CI build number.  I do this so I can use a CI build to test upgrades from any previously released version (ie. 1.2.0 -> 1.210.x).  I assume that MSBuild would detect the change to the include file.  The CI environment I run now always does full builds on clean repository clones so it's hard for me to say.  I do not trust incremental builds because at a previous job they regularly failed to detect changes and errors were not caught as a result.

-Tom

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Hoover, Jacob
Sent: Friday, November 04, 2016 9:58 AM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: [wix-users] Incremental builds

I'm trying to get incremental builds working, and I am fairly certain this is a MSBuild problem not a wix problem.  I have a Wix project which is built using a CI server where a build number is passed to the project as a property.  I then use a DefineConstants element in the wixproj to pass my custom property to wix via a variable.

SomeApplication.wixproj /p: BuildNumber={CI variable syntax for the build}

And in the wixproj:
<VersionMajorMinor>1.0</VersionMajorMinor>
<BuildNumber Condition=" '$(BuildNumber)' == '' ">2</BuildNumber> <ProductVersion>$(VersionMajorMinor).$(BuildNumber).0</ProductVersion>
    <DefineConstants>
      $(DefineConstants);
      ProductVersion=$(ProductVersion);
      BuildNumber=$(CIBuildNumber);
    </DefineConstants>

And finally in my Product.wxs, I consume the ProductVersion via:
<Product Id="*" Version="$(var.ProductVersion)" Name="..."

Is there some standard functionality in MSBuild I am missing to be able to say the build is dirty if a property changes? I know MSBuild looks at file timestamps to determin if a target is needed via the inputs and outputs, so what I am tinking I'd need to do is add a file for the DefineConstants, inject them into the compile DependsOnTargets, and then only write the file after reading the values and comparing them to the current DefineConstants if they are different. Shouldn't a DefineConstants change triggering a build be an intergral part of the wix targets?

Thanks,
Jacob


____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/


More information about the wix-users mailing list