WiX

WiX, Mercurial, TortoiseHg and the command line.

Bob posted a blog entry how to use TortoiseHg to access the WiX source code on CodePlex. I thought the blog post was great but suffered from one fundamental flaw. It required you to do a whole bunch of mouse clicking. Here's how to get into the WiX Toolset source code using the command-line.

Initial Acquisition

The following are the steps you need to get the source code the first time.

  1. Download and install TortoiseHg. This will add the all important hg.exe to your path.
  2. Start -> Run -> cmd.exe - opens a command shell.
  3. md C:\src\wix - creates a directory for the source code. You can put this wherever you want.
  4. hg clone -b wix35 https://hg01.codeplex.com/wix C:\src\wix - copies WiX repository from CodePlex to the directory you created.

Note that in the last step I only enlisted in the the WiX v3.5 source code branch using the -b switch. The WiX v2.0 source code (branch: wix20) and WiX v3.0 source code (branch: wix30) branches are also available but no development happens there. If you want to access other branches remove the -b switch and see the “Switching Branches” section below to pick one of the branches.

Keeping Up

Once you are set up, keeping up to date is easy.

  1. Start -> Run -> cmd.exe - open your command shell.
  2. cd /d C:\src\wix - change to the directory where you put your source code.
  3. hg pull -u - downloads the latest changes and merges them with your working directory.

I do most of my development from the command-line and I have been very pleased with how easy it is to work with Mercurial on the command-line.

Switching Branches

One last bonus command in case you want to switch back to look at something in an older or newer branch.

  1. Start -> Run -> cmd.exe - open your command shell.
  2. cd /d C:\src\wix - change to the directory where you put your source code.
  3. hg update wix30 - switches to the WiX v3.0 source code

Remember, if you specified a branch in your clone command, you will need to do a pull command to get the other branch before updating to it. Today there are four branches, three of which that might be useful and two more are planned:

  • default - you can ignore this branch today (inactive)
  • wix20 - source code for WiX v2.0
  • wix30 - source code for WiX v3.0
  • wix35 - source code for WiX v3.5 (active)
  • wix36 - source code for WiX v3.6 (future)
  • wix40 - source code for WiX v4.0 (future)

That’s it. Keep coding, you know I am! (where do you think that wix36 branch is going to come from?)