WiX

Let's Code - WiX: v3.14

During the final weeks of WiX v3.11 it was challenging just to find time to code much less write about the code. So our fun "Let's Code" sessions here were postponed while I focused on simply finishing WiX v3.11. But we are successfully past WiX v3.11 so let's talk about WiX v3.14. Actually, how about we create WiX v3.14 right now. Sound good? I thought so. Let's code!

Checkout

This is what I call a search and destroy mission. We search for all references of “11” and turn them into “14”. Of course, it isn’t a simple mass replace because sometimes “11” is the right answer.

Also, there are a couple special files to handle every new release: WixBuild.Version.targets and History.md. We’ll start with the specials then move on to the searching.

Time to start coding.

git fetch upstream
git merge --ff --ff-only upstream/develop
git checkout -b v314

Commit

First, we go in to tools\WixBuild.Version.targets and change the MinorBuildNumber to “14”. Then we reset the StartBuildYear to “2017”. The StartBuildYear controls the start of the “build” portion of the WiX version number. The algorithm is:

(current year - StartBuildYear) x 12 + (current month * 100) + current day

The net result is a build today would be “v3.14.604”

This is a nice scheme I learned back in 1998 when I was in Office. However, it struggles if you want to do multiple builds in a day. That isn’t a huge problem for the WiX Toolset but I’ve always been on the lookout for a better mechanism. Versioning based on git history is all the rage now. I’m seriously considering switching WiX v4.0 to use it.

But for WiX v3.14, we’re done with the version number. All of the build versions flow through those MSBuild variables.

History.md is even easier. I delete everything but the last line and change the last line in the file to:

## WixBuild: Version 3.14.0

That is the starting point for the running history we’ll maintain for v3.14. The release feeds parse the History.md to generate the descriptions for each build of the toolset. Speaking of release feeds, I need to make sure to add a new release feed for v3.14 to the web project.

Mental note: create a src/Web/Static/documents/releases/feeds/wix3-14.feed file.

Okay, now for the search and destroy. This is more an exercise of finding needles in haystacks than actual coding.

Honestly, I was expecting to find many hits that needed to be updated but was pleasantly surprised to only need a couple. First, I updated the UpdateUrl to point at a new feed for v3.14 (which I already made a mental note to create above). Then I fix the MSBuild targets files registry lookups that were added to work around breaking changes in MSBuild15. Finally, I change the bundle name from wix311.exe to wix314.exe.

git add History.md
git add src\common\WixDistribution.wxl
git add src\Setup\Bundle\Bundle.wixproj
git add src\tools\WixTasks\wix.ca.targets
git add src\tools\WixTasks\wix200x.targets
git add src\tools\WixTasks\wix2010.targets
git add tools\WixBuild.Version.targets
git commit

    > WiX v3.14

And (I think) we’re done. WiX v3.14 should be good to go.

Pull request

Until next time! Keep coding. You know I am.