9
votes

I am trying to install my Outlook Addin on client computers.

Unfortuantely, the Add-in can never be 'Enabled' it is always shown in the Disabled add-in section.

Is there a simple, step by step guide on how to create the correct setup application and install an outlook addin?

EDIT:

Ok so ive gone back to basics, but i still cant get it to install correctly.

I create a new Outlook Addin using VS2010 project wizard.

It generates files etc, and then i change my code like so:

namespace OutlookAddIn1
{
    public partial class ThisAddIn
    {
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            MessageBox.Show("Worked");
        }

        private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
        {
        }

        #region VSTO generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InternalStartup()
        {
            this.Startup += new System.EventHandler(ThisAddIn_Startup);
            this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
        }

        #endregion
    }

If i install this one, i get the same error message:

Not Loaded. The Managed Add-in Loader failed to initialize.

When installing the Add-in I ensure the registry keys are created:

enter image description here

I have also added the .manifest file and the .vsto file to the Setup project.

Still stumped!

3

3 Answers

11
votes

I think this tutorial might be useful for your reference.

http://msdn.microsoft.com/en-us/library/ff937654.aspx

Also, there are a few other things that you might want to check out. First, see if you have any COM exceptions thrown when you start up Outlook Addin. Normally addin will not be disabled automatically if it throws errors on startup. And you also want to have a look at loadBehavior registry key and see what values you got in there.

For details of LoadBehavior reg key, please refer to: http://msdn.microsoft.com/en-us/library/bb386106(VS.100).aspx

4
votes

With the help of woodykiddy, I eventually managed to build the installer and successfully install! Anyone coming here should visit the link provided in his post.

I just wanted to elaborate on the general process I followed to get it to work.

Firstly, the regisrty entries are important, especially the Manifest and LoadBehavior keys. Make sure it points to the correct installation location. You also need to ensure the correct runtimes are installed, e.g. VSTO 2010 for Office runtime, and Office Primary Interop Assembly (if required).

Also, it was important to manually add the *.vsto and *.dll.manifest created in the \Release\ folder of you Addin, to the Setup Project.

I found that the Register for COM Interop need NOT be checked, whilst the Make Assembly COM Visble property in the Applications Properties MUST be checked.

And finally, ensure any Microsoft *.dll's not containing *.Utilities.dll were Excluded from the Setup project.

Sorry one last thing, when installing, install for "Just Me" to a writable folder e.g. [LocalAppDataPath]. There are also other caveats when users do not have adminstrator priveldges.

0
votes

Here is a short check list on how to troubleshoot possible issues with Outlook Addin

(of course not everything is covered)

Is the plugin properly registered on the client machines?

Check registry entries (HKLM\Software\Microsoft\Office\Outlook\Addins) and regasm.exe

Also make sure Make Assembly COM Visble located in Project Properties -> Assembly Information is checked

Have you deployed all dependencies together with the plugin assembly?

Its important esspecially when you build your own setup (either through WIX or installshield, ...).

Is there an error in the plugin while starting Outlook?

Check event viewer for Outlook errors and warnings

It can also "disappears" when version number / GUID of the plugin assembly has changed or there is a conflict

Try to fix it by deleting the CLSID keys in registry

REM 64bit entry in HKEY_CLASSES_ROOT
reg delete HKCR\CLSID\{GUID} /f 

REM 32bit entry in HKEY_CLASSES_ROOT
HKCR\Wow6432Node\CLSID\{GUID}

and re-register the assembly through regasm.exe