This project has moved and is read-only. For the latest updates, please go here.

Product Version and TFS Builds

Jan 16, 2014 at 8:33 PM
When I create a new IsWix solution, the product version is set to "$(var.MSIProductVersion)". After building through TFS, the MSI version is set to 0.0.1.

Instead, I would like it to use the auto-generated TFS build number. I am using the TFSVersioning build template (https://tfsversioning.codeplex.com/).

Is there a way to set the MSI product version to the Assembly version used by the TFSVersioning template?
Jan 20, 2014 at 6:34 PM
Take a look at the .wixproj generated and you'll see that it sets MSIProductVersion=0.0.1 if it equals null. If you pass MSIProductVersion into the build it'll use that instead. For TFS you can do this in the build definition under the advanced section | MSBuild Arguments. /p:MSIProductVersion=1.2.3. However if you want to use TeamBuild properties it gets tricker. See: http://stackoverflow.com/questions/7232055/how-do-i-use-team-build-properties-in-msbuild
Jan 23, 2014 at 7:17 PM
Thanks Chris. I took your advice and passed the MSIProductVersion into the build by editing the template as described here: http://philcleveland.blogspot.com/2013/10/how-to-get-dynamic-version-using-wix.html
Mar 5, 2014 at 3:10 AM
It looks like in TFS 2013 there is a new way to do this. TFS now sets an environment variable that you can do a regex.match against. A future release of ISWIX will have this built into the project templates.
Dec 24, 2014 at 12:53 PM
IsWiX now currently parses the environment variable exposed by TFS 2013 build. The only requirement is that your build number format creates a sequence of build names like Something_A.B.C.D. If there are 4 fields the .wixsproj MSBuild Property function will use RegEx to extract the A.B.C.D.