How to install an Office Add-in Express

NoteThis article is intended only for add-ins built with the "Add-in Express" framework.

First, you must create a new project in Advanced Installer, at least Professional or higher, as you need to have access to our custom actions support.

You start by configuring your product name and other details in the Product Details page, then you go to the Install Parameters page and set the package type to:

  • Per-machine - if the RegisterForAllUsers property of the module is true
  • Per-user - if the RegisterForAllUsers property is false or, if you deploy a smart tag or Excel UDF

TipIf you install the add-in per-user your clients can install the application even if they are not administrators and also they can have different versions of it on different accounts on the same machine. Plus, if you ever want you can configure automatic and silent updates as the updater can install the new version without asking for administrator rights.

Now, you can add your application binaries in the Files and Folders page, under the folder "Application Folder." In this page, you define the folders structure, just as you want it to be created when the application gets installed.

Now, there is the last step, of configuring the custom actions that register (on install) and unregister (on uninstall) your Office add-in.

You need three custom actions:

  1. a custom action to register the add-in, on install and maintenance (i.e., when a repair is executed)
    Command: /install=“[#AssemblyName.dll]“ /privileges={user OR admin}
    Schedule it after Add Resources group, select Install and Maintenance as execution conditions.
  2. a rollback custom action to unregister the add-in if the installation fails
    Command: /uninstall=“[#AssemblyName.dll]“ /privileges={user OR admin}
    Schedule it immediately after the custom action registering the add-in, select Install and Maintenance as execution conditions too.
  3. a custom action to unregister the add-in on uninstall
    Command: /uninstall=“[#AssemblyName.dll]“ /privileges={user OR admin}
    Schedule it before Remove Resources group, select Uninstall as execution condition.

All three custom actions are “Launch attached file“ predefined custom actions for which you must use as a source the binary adxregistrator.exe. All of them must be configured with the option “When the system is being modified“ (deferred) enabled, excepting the rollback one which must be set to "During installation rollback."

ImportantIf you install the add-in per-machine all custom actions must also be configured with the "Run under the LocalSystem account with full privileges (no impersonation)" option enabled.

The custom actions should be visible in the Install Execution Stage sequence as highlighted in the following image:

Custom Actions

NoteThe parameter [#AssemblyName.dll] is a reference to your assembly. To add this reference right-click in the “Command“ field, select “File“ from the context menu and after that pick your assembly. You should NOT manually type this reference as it may not have the same name as the file.

Of course, this is just the basic configuration for your package to register the add-in on a machine where you have Office and all the prerequisites installed. However, you should not assume your users know this, so you should setup launch conditions to check for your Office application from Launch Conditions page and also add the correct prerequisite in Prerequisites page, to make sure everything required for your code to run is on the machine.