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 Product Details page, then you go to 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 will be able to install the application even if they are not administrators and also they can have different versions of it on different accounts from the same machine, if ever required. 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 Files and Folders page, under the special folder "Application Folder". In this page you actually 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 will register (on install) and unregister (on uninstall) your Office add-in. This is not hard at all but you must be careful to configure them correctly, otherwise you might spend some time on debugging failed installations.

You will have three custom actions, as follows:

  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 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 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. But you should not assume your users will know this, so for this 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.