Anatomy of an SDK update
Over the course of the past week or so I've been working on rolling out the Windows 7 SDK to our build machines. Doing so presented two challenges: Getting the SDK to deploy silently and properly, and updating the appropriate build configurations to use it. Neither of these may sound very challenging, and indeed, they didn't to me either, but because of a combination of factors this ended up becoming a week long ordeal. In this post I will attempt to detangle everything that happened. Let's start with the actual SDK installation. Unlike most other reasonable packages, the Windows 7 SDK is not distributed as an MSI package, but rather a collection of MSIs wrapped in an EXE. Unfortunately, this EXE doesn't enable you to do a customized, silent install - the precise thing we need. Vainly, I thought I could figure out the proper order and magic options to install the enclosed MSIs properly. Needless to say, this failed. To work around this I fell back onto using an Autoit script that would click through the interactive installer for me. It took some fuss, but not too much difficulty to get that working. Now, the fun part (of deployment). We use a piece of software called OPSI to schedule and perform software installations across our farm of 80 or so Windows VMs. OPSI runs very early in the Windows start-up process, and actually executes as the SYSTEM user. Well, it turns out that the Windows 7 SDK must be installed by a full user, not the SYSTEM account. This seems unnecessary, as we've deployed other SDKs through OPSI in the past without issue. After trying to fake it out by setting various environment variables I turned to the OPSI forums for some help. (As an aside, the OPSI developers have been fantastic in their support of our installation, many thanks to them.) It turns out that I'm not the first person to hit problems like this. They pointed me to a template for a script that works around such an issue. The solution ends up being:
- Copy installation files to the slave
- Create a new user in the Administrators group, set that user to automatically login at next boot
- Reboot, and run the package installation at login
- Restore the original automatic login, reboot
- Cleanup (delete installation files, remove the created user)
- If you're specifying LIB/INCLUDE/SDKDIR in a mozconfig, you must use Windows-style paths
- If you're specifying PATH in a mozconfig, you CANNOT use Windows-style paths - you must use MSYS style
- You can't test for these things properly without clobbering
- Windows Vista SDK (6.0a): mozilla-1.9.1 builds
- Windows 7 SDK (7.0): mozilla-central, mozilla-1.9.2, TraceMonkey, Electrolysis, and Places builds