So it's been a while since I've said anything; work's been busy.
One fun part of the canary process for this release was noticing partway through that our install rate started sucking. Some background: we use NSIS to build our main installer, which has its ups and downs. One of the performance enhancements of this release involved installing our managed assemblies into the Global Assembly Cache. However, Microsoft doesn't allow redistributing gacutil and we'd heard that rewriting gacutil using the .Net interface was time-consuming due to all the random corner-case error handling. NSIS doesn't have any sort of native support for installing to the GAC, either. We instead put together an MSI containing the assemblies to be GACd (and also installed into our Program Files folder, without including all the assemblies twice), built using WiX (which was really easy to slot into our build scripts). We then include that MSI in our NSIS installer, and call msiexec on it. Seems pretty straightforward, and since our installer already requires running as an admin, like there shouldn't be any trouble. Oh how wrong I was. While every machine in the office was able to successfully install, when we put it out in the field, it turned out we were losing 10% of our installs to the MSI failing to install. Not good.
Did some sleuthing, and fixed a few of the common errors (race conditions involving multiple MSIs being installed at once, and a few other smaller things), and got the failure rate down to 8%. Still not good. After much perusing of Google search results and MSDN, we worked around it. MSIs can install files located in external cabs, and WiX provides a convenient option to generate that cab. We now include both the MSI and the cab, and NSIS calls expand on the cab to put the assemblies into our Program Files folder while the MSI deals with putting them into the GAC. If the MSI fails, we won't startup as fast, but we'll still run at least.
End result is that the installer stays small by not including assemblies multiple times, if the MSI service is working on a machine, we'll get a startup speedup from GACing/NGENing the assemblies, and our install rate went back to normal.
Friday, April 24, 2009
Subscribe to:
Posts (Atom)