RibbonCustomizer™
Customize your Office 2007 Ribbon (Office Fluent™)with only a few mouse clicks! Works with Microsoft® Access™, Excel®, Outlook®, PowerPoint® and Word 2007.

Buy for $29.99

Download free Starter Edition

Subscribe | Subscribe by Email |

Categories

Archive


Creating a setup program for a Shared .NET Office 2007 Add-In

April 18th, 2007 by Patrick Schmid

Every Shared .NET Office 2007 add-in needs to be installed somehow. That means, as add-in developer you need a setup program for your add-in. Visual Studio 2005 creates a setup project by default for your add-in. However, the Visual Studio created setup program is totally inadequate for good Office 2007 add-ins. A good Office 2007 add-in setup program should fulfil the following criteria:

  1. Support Windows XP SP2 or greater, Windows Server 2003 SP1 or greater, and Windows Vista (those are the Office 2007 operating system requirements)
  2. Install only if Office 2007 is installed
  3. Install all necessary prerequisites and components as we simply cannot assume that they are already installed
  4. Install the COM shim for the add-in
  5. Install the add-in itself

The default VS setup program can be tweaked to do most of these things, but the key issue it fails at is supporting the three different operating systems with their different behaviours. Specifically Windows Vista behaves differently than XP and 2003 due to the introduction of User Account Control (UAC). Most Office add-ins do not require administrative privileges to run correctly. However, the VS created setup program will trigger UAC and hence standard user cannot install those add-ins. Worse though, if the add-in installs itself only for the current user (HKCU), the add-in will actually be installed into the context of the user that supplied the elevated privileges. That means, a standard user simply cannot use the add-in at all. The workaround for this problem is to install the add-in for the entire computer (HKLM), but this might not be desirable in a lot of circumstances. Worst of all though is that an add-in installed into HKCU for a user with administrative privileges will not run if UAC is switched off (it runs fine with UAC on).

In the next few blog posts, I’ll outline how to create a setup program for an Office 2007 add-in that works for XP, 2003 and Vista, whereby it can be installed by standard users on Vista and works with UAC off. I will use the Windows Installer XML (WiX) toolset v3. I’ll be using the unstable version 3 of the toolset, specifically one of the weekly releases (3.0.2813.0).

2 Responses to “Creating a setup program for a Shared .NET Office 2007 Add-In”

  1. AL Says:

    Thanks Patrick,

    This is likely to be useful to me when I have to create custom Task Panes add-ins for Access. I was wondering about the installation bit….

    AL

  2. pschmid.net - pschmid.net: Putting You & I back into Office 2007’s Ribbon UI - Setup for Shared .NET Add-Ins for Office 2007 - What do you need to install? Says:

    […] This is the second part of my series on creating a setup program for Shared .NET Add-Ins for Office 2007 (read Part 1). One of the toughest problems is figuring out what you should ship with your setup program besides your actual add-in. To ensure that your Shared .NET Office 2007 Add-In will work under any circumstance, you will need to include the following: […]