Friday, March 2, 2012

Random notes on automating Windows builds

  1. Install the version control system of choice. In this case, bitkeeper, but any other CLI-drivable vc system will work.
  2. Check out your directory tree of the various products you are going to be building.
  3. Install the *real* Microsoft Visual Studio 10
  4. Create a solution (Microsoft-speak for "makefile" though it isn't) for each of the individual solutions you are building as part of your overall product and make sure each solution builds. This will be saved in the file Foo.vcxproj (for some solution named Foo) in each solution's root directory.
  5. Add the directory that 'devend' and 'nmake' lives in to your PATH in your system config. Control Panel->System->Advanced SYstem Settings->Environment Variables, edit user variable Path. My Path looks like: C:\Users\eric.green\bitkeeper;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin
  6. Create a standard Unix-style makefile in the parent directory that has a list of the subdirectories to recurse into, then in each subdirectory, a Makefile that has 'devenv /build Foo.vcxproj' to build and 'devend /clean Foo.vcxproj' to clean.
  7. Test your make file with 'make', make sure that the proper .exe files are produced in each of your subdirectories.
  8. With Visual Studio closed, install Wix and Votive
  9. Use Votive to build a WiX project file and "compile" it to XML.
Once you've done this, then you can edit the Makefile at the root of your project so that after it recurses the directory, it runs the WiX commands:
  1. candle product.wxs
  2. light product.wixobj
The output should be product.msi.

Install Jenkins to integrate with the source control system, check from time to time for new checkins, then fire off a build via use of nmake when the checkins happen. Jenkins does run under Windows, with some caveats. See e.g. Setting up Jenkins as a Windows service. Biggest issue may be getting email to go out on Windows, will have to investigate that further once I get to that point.

--ELG

No comments:

Post a Comment