locked
How to do automatic updates for VSTO addin - installed using WIX not ClickOnce RRS feed

  • Question

  • Hi,

    I was wondering what the best way is to mass update addins that clients have installed.  As I see it there are two scenarios to account for:

    1) large client where users don't have admin permissions and typically addins are silently installed by IT departments

    2) smaller client where users might install addins themselves / have permissions to install

    For (1) I'm not sure there will be a way to update remotely, and we can just supply the updated .MSI file for the IT departments to roll out, however what is the common way to do it for (2)?

    Currently I am using Wix for packaging the addin, using an installer to create the .msi and then a bootstrapper to package into a .exe which then also checks for pre-requisites.  In the VS2013 project I have some code that will check a URL on addin startup to see if there is a new version, if it is greater than the installed version then it will download the zipped files for the latest one from this URL.  Once it has downloaded it then runs an Updater.exe file that extracts the files into the addin program files folder overwriting the old addin files.  When the user next restarts Outlook it will use these latest files and they will be on the latest addin.

    A few questions on this:

    - is this a good way to do this or am I missing an easy trick here?

    - we sign our code so that when running the normal addin .EXE install it doesn't say "Unknown publisher" when the windows prompt appears, however how do I sign the Updater.exe file in the same way and then package this within the addin install.exe file?  Whenever I have tried this it seems to remove the signing for the Updater.exe

    - Is there any way I can copy the downloaded files into Program Files without using Update.exe? I think I need it since trying to copy them from within the addin code won't provide the correct permissions to allow it.

    Thanks,

    Tom

    Tuesday, May 12, 2015 1:55 PM

Answers

  • Hello Tom,

    The Group policy can be used for deploying the software (add-ins) in big companies. 

    is this a good way to do this or am I missing an easy trick here?

    You need to use ClickOnce (not WiX, i.e. Windows Installer) if you want to get the auto-update feature. 

    Once it has downloaded it then runs an Updater.exe file that extracts the files into the addin program files folder overwriting the old addin files.

    Typically add-in files are blocked by the OS and can't be rewritten when the add-in is loaded. You need to shut down the host application for replacing the files. So, to update the add-in installed using Windows Installer you need to uninstall the software first. And then install a new version of the software. 


    On latest Windows OS the Program Files folder requires admin privileges for writing. You need to be sure that the installer has sufficient privileges to get the job done.

    You can read about possible ways in the Deploying an Office Solution by Using ClickOnce article.

    Tuesday, May 12, 2015 2:43 PM

All replies

  • Hello Tom,

    The Group policy can be used for deploying the software (add-ins) in big companies. 

    is this a good way to do this or am I missing an easy trick here?

    You need to use ClickOnce (not WiX, i.e. Windows Installer) if you want to get the auto-update feature. 

    Once it has downloaded it then runs an Updater.exe file that extracts the files into the addin program files folder overwriting the old addin files.

    Typically add-in files are blocked by the OS and can't be rewritten when the add-in is loaded. You need to shut down the host application for replacing the files. So, to update the add-in installed using Windows Installer you need to uninstall the software first. And then install a new version of the software. 


    On latest Windows OS the Program Files folder requires admin privileges for writing. You need to be sure that the installer has sufficient privileges to get the job done.

    You can read about possible ways in the Deploying an Office Solution by Using ClickOnce article.

    Tuesday, May 12, 2015 2:43 PM
  • Hi Eugene,

    I don't think I can use the ClickOnce since we need to provide a .EXE file install to many of our clients and it needs to check and install pre-requisites correctly.  Previously when I tried with click once I wasn't able to get this working as I wanted.

    Is there no other way to install an addin using WiX and then have it auto-update?  Do you know how  large corporations that provide addins (e.g. Bloomberg, FactSet, Reuters) to financial institutions keep their addins updated?  Especially when there is no IT department at the client who can roll out updates using group policy...

    Thanks,

    Tom

    Tuesday, May 12, 2015 3:38 PM
  • ClickOnce is used if you need to auto-update software. If not, the Windows Installer is used. In that case you need to uninstall the previous version and only then install a new one. Moreover, you need to close the application to get the job done in case of Office add-ins.

    Group policy can be used used for uninstalling an old version and then installing a new one.

    You may also find MSI web-based deployment - ClickTwice from ADX.

    Tuesday, May 12, 2015 3:47 PM
  • Hi Eugene,

    I think the ClickTwice method you linked to is actually what I am already implementing at the moment.

    • The bootstrapper installs the addin and the Update.exe
    • Then the addin will periodically check a URL for an update
    • If there is an update it will download the files to a temporary location and ask the user if they would like to update now
    • If the user clicks yes then it runs Update.exe which is separate from the addin and therefore can copy the downloaded files to the program files folder (assuming use has permission to write here)
    • It then prompts the user to restart Outlook so the changes can take effect.

    Rather than using a version.xml file, I store the current version in the addin itself and use that to check against the version at the URL.

    Does the ClickTwice method do anything differently that provides more functionality?

    Thanks,

    Tom

    Tuesday, May 12, 2015 4:12 PM
  • Tom, 

    I am not the developer of the ClickTwice installer.

    Anyway, I'd suggest asking deployment questions on the ClickOnce and Setup & Deployment Projects forum instead. WiX specific questions are going to http://wixtoolset.org .

    Tuesday, May 12, 2015 4:38 PM