Friday, 5 August 2011

Deployment of Outlook AddIn containing Custom Form Region

Steps to create Installer for Outlook Add In:
Setup Project Settings
1)      Add a Setup Project in the solution.
2)      Right click on setup project. Select View->File System. In File System tab right click on “Application Folder” and select Add-> Project Output. In “Add Project Output Group” select Primary Output.  Selecting primary output will add the required dlls in “Detected Dependencies” folder.
3)      Right-click the Application folder and select Add-> File. Browse to your application folder, and then bin\Release. Select the .dll.manifest, and .vsto files that reside there.
4)      Right click the Application Folder and select Properties Window option. In the Properties window, under DefaultLocation, change ProgramFilesFolder][Manufacturer]\[ProductName] to [AppDataFolder][Manufacturer]\[ProductName].

We’ve now effectively told the setup project to install all our application goodness to the user’s AppData folder (Normally C:\Users\[username]\AppData in Windows 7, for example). We are doing this as this is a safe, sandboxed location that requires a minimum of privileges to install to.
5)      Optionally in the Properties window for the Setup project change values for Manufacturer, Product Name and Version.  Values specified here will be replaced by the corresponding keys in step 4.

Registry Key Settings
To get the add-in working, we will need to add registry keys. When you are developing the solution in Visual Studio, this happens automatically in the background, so it can be a surprise that you will need to do it explicitly! The keys we are creating will be saved to: HKCU\Software\Microsoft\Office\Outlook\Addins.
Open the Registry Panel in the Setup Project and create keys as follows:
1)      Expand the HKEY_CURRENT_USER key, then Software, and rename [Manufacturer] to Microsoft (because we are adding this key to the Microsoft Office section of the Registry).
2)      Create a tree of key values underneath Microsoft: Office\Outlook\Addins
3)      Finally, create a key for your add-in. Give it a unique name, such that it is different from the add-in project name (so you can identify keys created by the installer, and keys created by Visual Studio).
4)      In that key, set the following values:
§  String – “Description”
§  String – “FriendlyName”
§  String – “Manifest” – set this to “[TARGETDIR]MyOutlookAddin.vsto|vstolocal”
[TARGETDIR] is a macro  and specifies the root destination directory for the installation.
§  DWORD – “LoadBehavior” – set this to “3”
(LoadBehavior and not LoadBehaviour!)
  1. Select the new key (the one you just set values for) and in the Properties window, set DeleteAtUninstall to be true (important: do not set it for any keys higher up in the tree!)  
  2. If there is a custom form region in the add in we need to specify separate registry keys as follows:
Under the IPM.Appointment key, string value of format ProgID.RegionName should be added. Value for this string should match with the new key added in the “AddIns” folder in 4th step.

Reference URL:

No comments:

Post a Comment