Andrei Smolin

Introducing automatic updates for Office extensions

Version 8.3 of Add-in Express for Office and .net added support for automatic updates when using ClickTwice – MSI-based web deployment technology (this technology is closely tied with Add-in Express).

Before you use the features described below, make sure your add-in doesn’t contain CheckForMsiUpdates calls!

Creating an add-in installer

You start with creating a setup project as described in section Deploying a per-user Office extension via an MSI installer of the Add-in Express manual. If you deploy a per-machine add-in, see section Deploying a per-machine Office extension via an MSI installer instead.

When the setup project is ready, you publish it using the ClickTwice publish wizard. Note that publishing with ClickTwice creates files, which you need to copy to the location accessible by the users of your add-in; the publisher dialog won’t copy the files for you.

Publishing the installer

To use automatic updates, click the Preference button (see the screenshot above) and tick the Enable automatic updates flag in the Preferences dialog window:

Setting up automatic updates

The Preferences dialog allows choosing these options:

  • You may prefer to check for updates when the host application starts or closes.
  • Alternatively, updates can be checked in the background in the specified intervals.

Publishing the add-in installer

At this point you can publish the add-in installer. When you do this, Add-in Express creates the MSIPublish folder within the add-in project folder. Now you need to copy all of the files and folders from the MSIPublish folder to the location accessible to end users via the URL specified in the Installation URL field (see the first screenshot).

The files and folders within the MSIPublish folder are described in Files generated by ClickTwice.

The main file is called downloader. If no prerequisites are specified, it downloads the .MSI file from {Installation URL}/{Language code}/{Version} and runs it. If prerequisites are specified, it launches setup.exe located in the prerequisites folder, waits for the prerequisites to get installed; and then downloads and runs the .MSI. The file name of the downloader is set to the name of your project, such as myaddin1.exe.

Installing the add-in

Provide the end user with the URL pointing to {Installation URL}/{Language code}/{Version}/{downloader file name} and let them download and run this file. Starting it installs prerequisites (if specified) and runs the add-in installer.

Creating an update

Modify the add-in project and change its version. Update the setup project and change its version. Create an installer for the updated setup project and publish the installer. Copy all the files from the MSIPublish folder to the location that the users access via the URL specified in the Installation URL field.

Automatic updates

When you publish the add-in, a set of important files is created in folder MSIPublish/{Language code}/{Version}/updater. These files are the updater application and its configuration file. When installing the add-in, the downloader also downloads the updater application; the updater checks for updates as specified by the developer. The settings of the updater application are available for the developer on the Preferences dialog:

Setting up the updater application

When the updater detects an update, it creates an icon in the notification area and displays the balloon tip:

'Update is available' Notification

In the screenshot above, you see the icon specified in the Publish dialog.

Clicking the notification icon produces the following dialog (this form is fully customizable via the OnUpdaterUICreate event of the ClickTwice module):

Updater form

Clicking the Download button downloads the downloader for the new version and starts it. The downloader checks that the host application(s) is closed and starts the installer.

5 Comments

  • https://secure.gravatar.com/avatar/7bc03fb43e3087d52daa0e4b5eb74808?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D32&r=G Eugene says:

    Looks great! Can’t wait to try it out.

    One minor thing is to consider – make all windows theme aware. Built-in tools should correspond to the host UI.

  • https://secure.gravatar.com/avatar/29957f26ad2d8ba527fd9cc8cfa7b2e0?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D32&r=G Andrei Smolin (Add-in Express Team) says:

    Hello Eugene,

    Thank you for the suggestion!

  • https://secure.gravatar.com/avatar/bd025fc2de83cb139a4f793dfad6b14d?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D32&r=G Jitu Patidar says:

    Seems a great feature…

  • https://secure.gravatar.com/avatar/174ef9a8210b673f4f53aff9b4d49b73?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D32&r=G mikky says:

    It seems great,thank you for your sharing.

  • https://secure.gravatar.com/avatar/8499209fb1ff37a9de13386b40403c19?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D32&r=G Duke Vukadinovic says:

    I’m sure that many will disagree with me but I really like the idea that Microsoft Office 2016 is running on an auto-update feature, similar to Windows 10. It’s a quite handy feature for us who suffer from short term memory amnesia :)

Post a comment

Have any questions? Ask us right now!