Versioning the MSI with Team Build

Parent Previous Next

The deployment project file (.btdfproj) includes a PropertyGroup that contains many MSBuild properties that help define the MSI.  They include ProductVersion, ProductId, ProductName, ProductUpgradeCode and more.  The important properties related to Team Build and MSI versioning are ProductVersion and ProductId.


Deployment projects build in Team Build using MSBuild, just like any other .NET or BizTalk project.  That means you can directly reference any MSBuild property that is defined by Team Build.  You can also modify your build process to pass a property value into MSBuild.exe with the /p switch.


If you generate or maintain a build version number formatted like X.Y.Z, you can pass it to MSBuild.exe with the parameter /p:ProductVersion=X.Y.Z to override the explicit value of ProductVersion in the .btdfproj file with the value provided during the build.  You could also replace the explicit value in the .btdfproj file with an MSBuild property reference, using a property name that will be defined during the Team Build process:  <ProductVersion>$(TeamBuildProductVersion)</ProductVersion>.


Any blog or other reference that discusses generating and maintaining version numbers in Team Build should directly translate to your Deployment Framework projects.


For Windows Installer to be able to automatically upgrade your application MSI's (see Enabling Automatic Upgrade in the MSI), you must increment the ProductVersion and replace the ProductId.  The ProductId is just a GUID, so you can follow steps similar to those discussed above to override the explicit ProductId in the deployment project file.


NOTE: Windows Installer only considers Major.Minor.Revision when automatically upgrading an MSI, so for auto-upgrade to work you must increment one of those three components.



Created with the Personal Edition of HelpNDoc: Write eBooks for the Kindle