Deploying an Office solution using Windows Installer (Mary Lee)

Visual Studio 2008 offers a ClickOnce deployment experience for solutions developed for the 2007 Microsoft Office system.  However, if you want to deploy additional files, add extra registry keys, or use SMS, you may still be interested in creating a Windows Installer package.

Here are the very basic steps to configure your setup project:

1. Add the release build or publish output of your solution. Then manually add the application and deployment manifests (.dll.manifest and .vsto files).

2. For application-level projects, create the registry keys so that the Microsoft Office application can find your add-in. For more information, see Registry Entries for Application-Level Add-Ins. For the add-in name, use a syntax similar to [CompanyName].[AddinName].

3. For document-level projects, update custom document properties which point to the location of the deployment manifest. If you leave the document in the same relative location compared to the customization assembly, you don’t need to update the _AssemblyLocation property. But if you want to move the document to a user’s desktop or Documents folders, you’ll have to update the _AssemblyLocation property. For more information, see Custom Document Properties Overview.

You must still use ClickOnce security to trust your solution. You can deploy your .msi at this point, but you’ll see a trust prompt asking whether the solution should be installed or not. To avoid prompting your end users, sign your manifests with a known and trusted certificate or pre-trust the solution by creating an inclusion list entry. For more information, see Security in Office Solutions (2007 System).

Bonus: there is sample code to help you complete the steps of deploying additional files, updating the document’s _AssemblyLocation, and creating an inclusion list entry.  Visit http://code.msdn.microsoft.com/VSTO3MSI in the MSDN Code Gallery to download the sample code.

For all the details, read the deployment whitepapers at Deploying a Visual Studio Tools for the Office System 3.0 Solution for the 2007 Microsoft Office System Using Windows Installer (Part 1 of 2) and Deploying a Visual Studio Tools for the Office System 3.0 Solution for the 2007 Microsoft Office System Using Windows Installer (Part 2 of 2).

If you run into trouble implementing this, visit the VSTO MSDN forum at http://forums.microsoft.com/msdn/showforum.aspx?forumid=16&siteid=1 to search for answers or ask your questions. 

Mary Lee, programming writer.