[wix-users] Incremental builds

Hoover, Jacob Jacob.Hoover at greenheck.com
Fri Nov 4 07:57:58 PDT 2016


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



More information about the wix-users mailing list