Creating an Installer for a GWM Visual Studio Add-InLocate this document in the navigation structure

Prerequisites

Make sure that you have created a GWM add-in template as mentioned in the Creating GWM Outlook Add-In Template, to be deployed in Microsoft Outlook or Excel.

Context

This step-by-step procedure is based on the process in Visual Studio 2010 to create an installer for users to install a GWM Outlook add-in, or a GWM Excel add-in, in their system.

The section uses an example based on the Contacts add-in Creating and Working with Contact Template that will allow us to access all the CRM contacts from Outlook.

Note Only the basic steps to build MSI installer in Visual Studio 2010 are provided in this section. For information on any further changes and checks to be implemented, use the standard Microsoft rules.

Creating an installer for a GWM Visual Studio Add-in consists of the following procedures:

Procedure

  1. Creating a new setup project for your installer.
  2. Adding the files to be deployed to the project.
  3. Creating the registry key hierarchy.
  4. Deleting the installer components from the user's machine.
  5. Defining the launching conditions.
  6. Defining the configuration manager settings.

Creating a New Setup Project

Procedure

  1. Right click on your GWM add-in project (Solution located at the top of the Solution Explorer, and select Start of the navigation path Add  Next navigation step  New Project End of the navigation path.

    CI_ANP

    The Add New Project window appears.
  2. Expand the Other Projects Types folder located in the Installed Templates tree region on the left side on the window.
  3. Select Start of the navigation path Setup and Deployment Next navigation step   Next navigation step  Visual Studio Installer End of the navigation path.

    ANPW

    The details region displays the list of setup and deployment options.
  4. Select Setup Project.
  5. Enter a name for the project in the Name field located at the bottom of the screen
    Enter the name the new project. For example, VSTO Installer.
  6. Click OK.
    The File system window might open.
  7. Right click on the new project, and select Start of the navigation path Add  Next navigation step  Project Output End of the navigation path.
    The Add Project Output Group window appears.
  8. Select the GWM project from the Project drop-down list.
  9. Select Primary output in the details region.
  10. Click OK.
    The dependencies for the selected project will be loaded under the Detected Dependencies folder of the new setup project.

Adding Files to Your Setup Project

Procedure

  1. Right click on the new setup project you have created, and select Start of the navigation path Add  Next navigation step  File End of the navigation path.
    The Add Files window appears.
  2. Navigate to the location of the project folder, and drill down into the bin folder, and open either the Debug or Release folder based on the mode of the build.
  3. Select the following files:
    1. *.config
    2. manifest
    3. *.vsto
      If these files are not found, then you must build the project again.
      Make sure that you include any translation DLLs or any other DLLs that are important for your application to run.
  4. Click Open.
    The selected files are loaded under the new setup project.

Creating the Key Hierarchy

Procedure

  1. Right click on the new setup project, and select Start of the navigation path View  Next navigation step  Registry End of the navigation path..
    The registry for the project opens. Next you have to create a key hierarchy as detailed in the following steps.
  2. Under Registry on Target Machine, right click on User/Machine hive and select New Key.
    The new key appears in editable mode.
  3. Enter Software as the name for the new key.
  4. Repeat the above step to build the following key hierarchy:
    1. Microsoft
    2. Office
    3. Outlook
    4. Addins
    5. SAP.GWPAMAddin
      You can choose any name for the last node to make it unique. Follow a naming convention. For exmaple, [CompanyName].[ApplicationName].
    Now that the key hierarchy is created, next let us create values for the last key.
  5. Select the last key, and right click in the details region to display a shortcut menu.
  6. Do the following using the shortcut menu:
    1. SelectStart of the navigation path New Next navigation step String Value End of the navigation path.
      A new string appears in the Name column in editable mode.
    2. Enter Description as the Name.
    3. Enter GWM Add-in as the Value
      Use the Properties view to specify the values. Right click on the Name and select Properties Window (F4).
    4. Enter a description of your choice.
  7. Repeat the steps mentioned above to add New, types, names, Values, and description as follows:

Name Type Value To Do
Description String GWM Add-In You can enter your own description
FriendlyName String GWM Add-In Enter a friendly name of your choice.
LoadBehavior DWORD 3 Do not change this value. This value tells Outlook to load the addin at startup.
Manifest String [TARGETDIR]contacting.vsto|vstolocal Specify your vsto file name in the place of contacting.vsto
Note It might be possible that the installer we are creating may be used with different system architecture (i.e. x86 or 64 bit), or may be with different version of Office (32 bit or 64 bit Outlook). The screen shot below shows an installer which has all the required registry structure (it is possible for the installer in this instance to run on either 64 bit or 32 bit machine. However, make sure that you remove the entries of the architecture that are not used.

bit_structure

  1. Repeat the steps for all the keys created in step 6 above.

Deleting the Installer

Procedure

To ensure that the installer gets deleted when the *.msi is deleted, follow these steps:
  1. Right click on the last key, SAP.GWPAMAddin that was created and select Properties Window.
  2. In the properties window, navigate to DeleteAtUninstall and set the value to True.

Defining Launching Conditions

Context

Create launching conditions to check if Outlook and Microsoft .NET Framework applications are present before starting the installation.

Procedure

  1. Right click on the project and select Start of the navigation path View  Next navigation step  Launch Condition End of the navigation path to open the Launch Condition editor.
  2. Right click on the project and select Start of the navigation path View  Next navigation step  Launch Condition End of the navigation path to open the Launch Condition editor. The Launch Conditon editor for the project opens in the details view.
  3. Right click the Requirement on Target Machine in the launch condition editor and select Add Registry Launch Condition. The Search for RegistryEntry1 condition appears in the Search Target Machine folder
  4. Right click on the Search for RegistryEntry1condition and select Properties Window.
  5. Do the following in the Properties window:Set the value Search for Office 2010 VSTO Runtime for Name. Set the value OfficeRuntime for Property. Set the value of RegKey to SOFTWARE\Microsoft\VSTO Runtime Setup\v4. Leave the Root property set to vsdrrHKLM. Change the Value property to Version.
  6. Similarly, add another Registry search following the same steps as mentioned in “step 5” above, search for VSTO redistributables. After adding the new search entry, fill up the properties windows with the following:Set the value Search for VSTO 2010 Runtime for Name. Set the value VSTORUNTIMEREDIST for Property. Set the value of RegKey to SOFTWARE\Microsoft\VSTO Runtime Setup\v4. Leave the Root property set to vsdrrHKLM. Change the Value property to Version.
  7. Right click on the Condition 1 launch condition that you created, and click on Rename. We will rename the condition to Verify VSTO 2010 Runtime availability.
  8. Delete the extra launch condition that might have been created due to the steps above. Generally it would be with the name Condition 2. (if you have followed the steps)
  9. Select the Verify VSTO 2010 Runtime Availability launch condition defined earlier in the Launch Conditions (VSTOInstaller) editor.
  10. Right click the condition and select Properties Window.
  11. Change the value of the Condition property to the following:VSTORUNTIMEREDIST="10.0.30319" OR OFFICERUNTIME>=”10.0.21022

    Properties_VSTO

  12. Configure the launch conditions for Office 2010 Shared PIA as follows:In the Launch Conditions (VSTOInstaller) editor, right-click Requirements on Target Machine, and then click Add Windows Installer Launch Condition.
    This launch condition searches for the Microsoft Office 2010 Shared Primary Interop Assembly by searching for the specific component ID.
  13. Right-click Search for Component1 and click PropertiesWindow to show the properties of the launch condition.
  14. Do the following in the PropertiesWindow:Set the value of the (Name) to Search for Office 2010 Shared PIA availability. Set the value of the ComponentID property to 1D844339-3DAE-413E-BC13-62D6A52816B2. Set the value of the Property to HASSHAREDPIA.
  15. Right-click Condition1 and click Properties Window to show the properties of the launch condition, and do the following:Set the value of the (Name) to Verify Office 2010 Shared PIA availability. Set the value of the Condition to HASSHAREDPIA. Leave InstallUrl blank. Set Message to A required component for interacting with Outlook is not available.
  16. Right-click Condition1 and click Properties Window to show the properties of the launch condition, and do the following:

    Set the value of the (Name) to Verify Office 2010 Shared PIA availability .

    Set the value of the Condition to HASSHAREDPIA.

    Leave InstallUrl blank.

    Set Message to A required component for interacting with Outlook is not available.

    The final set of launch conditions should look as follows:

    Launch Conditon

    .

Defining a Configuration Manager

Procedure

  1. Right click on the solution file and choose Configuration Manager.Configuration
    The Configuration Manager window appears.
  2. Select the VSTOInstaller project.
  3. Build the project and navigate to the bin folder of the installer project.
    You will find the installer that you have created. Install the add-in.