I've been working on the next step of my continuous integration project, which is to get TeamCity to build my application, automatically change the version number of all assemblies, and then create an installer.
A little background first:
I've been running TeamCity successfully for the past several months, and it builds my configurations and runs my NUnit and NCover tests just fine.
I took a little time researching installers -- I have always hated InstallShield and never considered it for my current application. I like NSIS, but then happened to come across WiX. I don't have any intimate knowledge of the MS Installer architecture, which I understand is dangerous for complicated projects, so at some point I'll need to learn more about it. However, after a few days of wading through SO questions, googling, and reading blogs, I have a WiX project that successfully builds, installs, the application runs, and everything uninstalls cleanly. Great!
I also wanted to have the TeamCity build configuration automatically update the version number of all of my assemblies. I was able to mock up this functionality by installing the MSBuild Community Tasks on my development machine, and creating a Deployment configuration that uses a BeforeBuild target and the FileUpdate task to change the version number. That works properly, except that on my development machine, I don't have a build_vcs_number_1 environment variable to substitute.
So that's where I am now -- I need to have TeamCity do the update, and while it does have the build_vcs_number_1 environment variable, I can't figure out how to get at the WiX MSBuild Community Tasks.
One post I read recommended checking in the MSBuild targets into an SVN folder. I have an /extlib folder for things like this, so my TeamCity VCS checkout rules look something like this:
+:tags/2010-10-15=>src
+:extlib=>extlib
How do I get to extlib from an environment variable? When I run the build, TeamCity complains (and correctly so) that it can't find c:\wix30\MSBuildCommunityTasks
. The actual folder is C:\TeamCity\buildAgent\work\3e073d2b74226378\extlib\wix30\MSBuildCommunityTasks
. The folder is auto-generated since I'm doing a server-side checkout, so there must be some environment variable that TeamCity sets that I can use to get the correct path.
One thing I should note is that I've gone into the build configuration -> Properties and Environment Variables and found the unintuitive droplist with all existing variables, and didn't see anything that sounded like a variable that points to the work path.
One possible workaround I can think of is to just install MSBuild Community Tasks on the build server, and then I can create a system environment variable that can be accessed by <WixToolPath>
.
Does anyone have other suggestions?