The WiX toolset presents the Creative Commons Add-in for Microsoft Office.

Creative Commons Add-in for Microsoft OfficeI have been working on a few unrelated side-projects over the last several months. These are projects that I find interesting and typically relate to software installation in some way. Today Microsoft released the first of these projects, the Creative Commons Add-in for Microsoft Office.

Essentially, the Creative Commons Add-in for Microsoft Office is a small piece of code that adds a "Creative Commons" item to the File menu in Word, Excel, and PowerPoint. The "Creative Commons" menu item brings up a dialog that allows the use to choose a Creative Commons license for their document. The cool part is that the license is fetched from the Creative Commons web site via a web service exposed by Creative Commons. This web services allows the add-in to stay current with licenses should they change.

You can read a bit about the add-in in the news here and here.

But what does this have to do with software installation?

Well, that's the interesting part of the story. You see when it came time to deliver the Creative Commons Add-in for Microsoft Office, there were some installation hurdles. First, the add-in is managed code that integrates with both Office XP and Office 2003. To integrate with Office via managed code you need the Office Primary Interop Assemblies (PIAs). To make things even more complicated there are PIAs for Office XP and PIAs for Office 2003. This means we need a boostrapper/chainer to handle the multiple MSI packages.

Second, it turns out that the Office XP PIAs were released as a collection of DLLs and .reg files with a register.bat that called gacutil.exe and regedit to register the files (there is no uninstall). This offended my setup sensibility on so many levels that I am still struck with awe that Microsoft released that as the solution for managed code interop with Office XP. Obviously, there was going to be work to do here.

Third, the original MSI package for the Creative Commons Add-in for Microsoft Office was created via Visual Studio. Anyone who knows me well knows how much frustration the Visual Studio setup projects (VSI) cause me. VSI creates truly ugly MSI packages, adds all kinds of junk to it and doesn't do some basic things correctly. In this particular case, the SelfReg table was being used to write several registry keys. The MSI SDK documentation explicitly calls out that you should not use SelfReg, yet here it was.

Anyway, back to the story. Martha Nalebuff is the mastermind behind the whole project. When she hit all of these problems she was at a loss for what to do. Fortunately, she ran into Jason Matusow who, after listening to the problems, pointed Martha at me. Martha had a meeting with several of us that work on the WiX toolset at night and we assured her this was something we could help with.

I was already working on a bootstrapper for ClickThrough and knew that adding the necessary chainer features wouldn't take much work. Bob Arnson picked up the Office XP PIA travesty and converted it into an MSI package (I'll talk about this in the future). Reid Gustin put together the pieces we needed that turned into the CloseApplications CustomAction in WiX toolset (turned out we had to shutdown the Office applications when installing the add-in). Finally, I took apart the VSI generated MSI package and created a much cleaner .wxs file for it.

The end result is the ccsetup.exe that you can now download for free from Microsoft.

Personally, I participated in this project for three reasons. First and foremost, I believed in the project and wanted to see it succeed. Enabling "creators of all types" to share their works as they see fit is a noble goal. Second, I wanted to learn more about how to install Office add-ins. I believe that there is no better way to learn than by doing. Finally, I wanted to be a part of something that would ship quickly. It is all too easy to become very disconnected from the real world while working heads down on multi-year projects.

Over the next month or so I'll be telling the story about the development of each of the pieces of the Creative Commons Add-in for Microsoft Office. I'll share what I learned along the way and what I plan to do with this information going forward. Stay tuned. Some real world software installation experiences will be coming this way soon.