SCCM application: Microsoft Dynamics CRM 2015 Outlook plugin

2016-11-30 23:30:00 -0500Posted by naf

 

I’ve got an application setup for the Microsoft Dynamics CRM 2015 Outlook plugin I’d like to share!

It includes two components: The plugin itself (including several prerequisites and two updates) and an end-user configuration. It took me a few days to nail down some edge cases, so I hope this helps out someone else.

Our environment, testing conditions

Our environment assumes the following are installed:

  • Microsoft Outlook 2010, 32-bit
  • PowerShell 2.0 (minimum) on Windows 7 x64

Caution: Visual C++ 2013 runtime installer

When the 64-bit Microsoft Visual C++ 2013 libraries (msvcp120.dll, msvcr120.dll, etc) are present but not installed through the runtime installer, running the 32-bit runtime installer will delete these files.

This plugin will execute the 32-bit MSVC 2013 runtime installer automatically, which can trigger this issue and cause many programs, including SCCM itself to stop working.

In this guide, the extra step of running the 64-bit runtime installer fixes the issue.

Packaging the installer

Download the primary components

Download the installer components from Microsoft’s web site:

  • Microsoft Dynamics CRM 2015 for Microsoft Office Outlook (32-bit)
    • Extract to a directory named “Client”
      CRM2015-Client-ENU-i386.exe /extract:Client
  • Update 1.2 for Microsoft Dynamics CRM 2015
    • I bundle two installers for that update: Both CRM2015-Client-KB3141809-ENU-I386.exe and CRM2015-Mui-KB3141809-ENU-I386.exe. This is due to the ENU installer saying you may need to install the language pack update after it’s done installing.
    • If your environment is EN-US only, you may not need the second component. It won’t hurt, though.
    • Extract those updates to “Update1” and “Update2” folders
      CRM2015-Client-ENU-i386.exe /extract:Update1
      CRM2015-Mui-KB3141809-ENU-I386.exe /extract:Update2

These steps will have left you with three folders: Client, Update1 and Update2. We’ll be adding extra runtimes to the Client folder, although if you skip these steps, the installer will download the missing components by itself.

Download the prerequisite installation files

Inside of the Client folder, you’ll need to retrieve some extra files and place them into some new subfolders. The files you’ll need are (summarized):

Please note, not all of these components are used. I haven’t tested on 32-bit Windows or 64-bit Office, but your use case might require them. See the full documentation for more information.

Package it up

With 7-Zip, add the three main directories (Client, Update1 and Update2) to an archive called crm.7z (or rename appropriately and modify the scripts). It should look something like this:

Screenshot of the three folders in 7-Zip

Extract 7za.exe from the 7-Zip Extras package and put it in the same directory as crm.7z. The DLL is not required.

Create your CRM configuration

Next is to configure your organization’s Dynamics CRM configuration file. It’s not one size fits all, but there are several guides and tools to assist you with creating one.

Here’s what one could look like:



Save this file as config.xml.

System component installer


Download

Save this file as setupcrm.ps1. You may want to modify it to your liking.

There’s an optional, commented out part around lines 44-51 to remove the extracted folders to save space. SCCM will eventually do it by itself to clean the cache, but it’s a good idea to do if you have extra time per-install.

Here’s what your installation content folder will look like:

7zr.exe
config.xml
crm.7z
setupcrm.ps1

System component SCCM application

Deployment type

Setting Value
Name Microsoft Dynamics CRM 2015 Outlook plugin
Installation program powershell.exe -ExecutionPolicy Bypass -NoProfile -File "setupcrm.ps1"
Detection type File System (File)
Detection path %ProgramFiles(x86)%\Microsoft Dynamics CRM
Detection filename SetupClient.exe
32-bit application True
Installation behavior Install for System
Installation visibility Hidden
Maximum allowed run time 60 (Set higher if you have much slower clients)
Estimated installation time 30 (25 minutes + padding on our average clients)

Feel free to put in additional requirements, such as depending on Microsoft Office.

User component

The user component has two files: The config.xml you generated before, and a PowerShell script.

Outlook requirement

This configuration utility will not work if the user does not have Outlook set up yet. This component will fail if you decide to include it in your OSD.

The plugin itself will install just fine, however.

Edge case: First attempt failure

One edge case we had was, it sometimes took two or three attempts at running the configuration tool before it worked. Trying again with the exact same parameters would be enough– so this script will just retry two extra times before giving up.

Configuration script


Download

You’ll want to replace $MagicString with the value you have between your <Organization></Organization> tags in your config.xml file. To be sure, take a look at what the log file says during a test run.

Deployment type

Setting Value
Name Microsoft Dynamics CRM 2015 user configuration
Program powershell.exe -ExecutionPolicy Bypass -NoProfile -File "usersetup.ps1"
Detection type Registry
Detection hive HKEY_CURRENT_USER
Detection key Software\Microsoft\MSCRMClient
Detection value OrgFriendlyName
Data type String
Rule operator One of
Rule value (line 1) MYNAME (The value of FriendlyName="" in your config.xml)
Rule value (line 2) crm (The value between your <Organization></Organization> tags in config.xml)
Installation behavior Install for User
Installation visibility Hidden
Maximum run time 30
Estimated installation time 15
Dependencies Add the system component as a dependency (auto-install)

If you want to make detection more reliable, you could consider modifying the PowerShell script to return an error code based on the log file and/or registry value it’s checking for.

Final words

I deployed this as an available program in our organization’s Software Center and it’s going well so far.

Please give me a shout on Twitter if this helped you at all, or if you have any feedback or corrections.