Pieter van der Westhuizen

Deploying your Add-in Express solutions

What we as developers often leave as an afterthought or the very last task on our list when developing applications, is the deployment and installation of our products. In our enthusiasm to “get the product out of the door” we forget that. What is an afterthought for us, are our users’ first experience and impression of the product. If it is a painful exercise for the user, your product almost immediately starts off on the wrong footing.

Fortunately packaging and deploying a solution you developed with Add-in Express, is a far lesser challenge than traditional ways of deploying MS Office Add-ins.

Add-in Express provides three methods of deployment:

  • ClickOnce
  • MSI based installer
  • ClickTwice or Web Based MSI Installer

Building the add-in installer

ClickOnce

To start, we’ll look at how to build a ClickOnce installer for your Add-in Express project. Open an existing ADX COM Add-in project. Right-click on the project name in Visual Studio’s Solution Explorer and select Publish ADX Project from the context menu.

Publish ADX Project

You will be presented with the publish dialog.

Publish dialog

Click the Populate button in order to populate the list of files required for the add-in. The provider URL is where your users will install the add-in from and where the add-in will check for newer versions. This can either be a website address of file share location on a network.

By clicking on the Prerequisites button you can specify the prerequisites your add-in needs in order to run. If the user does not have the required prerequisites on their computer the installer will automatically download and install it from either the component vendor’s website or the same location as you application.

Prerequisites

Once you’re finished specifying the prerequisites, publish your add-in by clicking on the Publish button. The installer will be created in the Publish folder in your solutions’ folder. If you specified prerequisites and that they should be downloaded from the same location as your application, you will notice folders for each prerequisite have been created in the same folder as your applications’ publish folder.

Folders for each prerequisite has been created in the same folder as your applications' publish folder

MSI Based Installer

To create a MSI Based Installer for your add-in right-click on the project name in Visual Studio’s Solution Explorer and choose Create Setup Project from the context menu.

Creating Setup Project

This will start the New Setup Project Wizard. You can specify the Add-in’s title, description, product name and company. The fields will automatically be populated with the information specified in the Assembly Information of your project. At this point, if you have InstallShield, you may choose to create an InstallShield installer instead of a Visuals Studio Installer by selecting the InstallShield radio button.

Creating an InstallShield installer

After the wizard finishes, it will add a Visual Studio setup project to the solution.

Adding a Visual Studio setup project to the solution

ClickTwice or Web Based MSI Installer

ClickTwice is a combination of ClickOnce and the MSI Installer. You would create a ClickTwice installation in a similar way to the ClickOnce installer by right-clicking on the project name in Visual Studio’s Solution Explorer. Then select Publish ADX Project from the context menu and the MSI tab on the publish dialog.

MSI tab on the Publish dialog

The Installer File field needs to be set to an existing MSI installer file, as we’ve build previously. The Publishing Location is the file location to where the files will be published; in this case it will be published in the same folder as your solution. The Installation URL is where your users will install the add-in from and where the add-in will check for newer versions. As mentioned previously, this can either be a website address or file share location on a network. You can specify an icon file for the installer as well as the certificate file.

When you click the Publish button, it will build the installer in the Publishing location file path.

Installer in the Publishing location file path

InstallShield

InstallShield enables developers to build Windows Installers (MSI) and can also be used to build the setup for your Microsoft Office add-in. In order to create an InstallShield setup package, right-click on the project name in Visual Studio’s Solution Explorer and select Create Setup Project from the context menu.

Creating Setup Project

On the New Setup Project Wizard select the InstallShield radio button and finish the wizard. The InstallShield installer project will be created in your solution with all the standard InstallShield functionality. Use the InstallShield project assistant to specify:

  • Application Information: Company Name, Application name, etc.
  • Installation Requirements: Specific operating system, Software prerequisites
  • Installation Architecture: Allow the user to select which features to install
  • Application Files: Which files need to be deployed, this will be automatically populated with the files required by your add-in
  • Application Shortcuts: Create shortcuts which will allow the user to launch your application from the Windows Start menu. This is something you might not need too often with Microsoft Office Add-ins.
  • Application Registry: If your add-in stores information in the Windows Registry, you can set up the registry keys and values.
  • Installation Interview: Set up your installation’s user interface e.g. Show License Agreement dialog etc.
  • Installation Localization: Provide localized setups for your users.

InstallShield project assistant

After you have completed the project assistant, you are ready to build your setup project. This will create a setup.exe file which your users can download and install from the internet or burn it to a dvd or cd.

Redeploying/updating the add-in

All applications will have to be updated from time to time and ideally the process of installing an updated or new version of the add-in should be a quick and painless experience for the user.

ClickOnce

You can enable your ClickOnce installation to be self-updating, which means it can automatically check for updates and replace any updated files. This check can be configured to run on or after startup. By using the ClickOnce API the update behaviour can be customized programmatically, which means, for example, you can add a “Check for updates” button to your add-in, which your user can click to check for any updates to your add-in.

Bear in mind that the user would need to restart the host application in order for the updated version of the add-in to be loaded.

MSI Based Installer

When releasing a new version of the add-in with a MSI based installer, the installation will check if an older version of the add-in is already installed and display an information message informing them. The user then needs to uninstall the old version before installing the latest version of the add-in.

ClickTwice or Web Based MSI Installer

ClickTwice provides similar functionality for updates as ClickOnce whereas, as a developer you can add code to programmatically check for updates to your application. If new updates are available, the path or url to the update will be returned. The developer then has a choice to automatically launch the setup or inform the user on where to download or launch the update from.

Thank you for reading. Until next time, keep coding!

You may also be interested in:

Add-in Express 2010 MSI-based web deployment – ClickTwice :)
Add-in Express 2010 MSI-based web deployment: Publishing the application, part 2
Add-in Express 2010 MSI-based web deployment: Managing updates, part 3

2 Comments

  • Nasim says:

    Hi,
    I have created a package by clickonce. After installing it creates a shortcut for the addin.
    How Can i avoid creating shortcut on client machine.

  • Andrei Smolin (Add-in Express Team) says:

    Hello Nasim,

    Add-in Express doesn’t create it. It is created by ClickOnce. According to our guys there’s no way to avoid creating it.

Post a comment

Have any questions? Ask us right now!