Sonoma Partners Microsoft CRM and Salesforce Blog

CRM 2013 Spring ‘14 Package Deployer Tool

The Package Deployer is a new tool that was released with the CRM Spring ‘14 update and provides administrators with an easier way to deploy to CRM organizations.  The Package Deployer can deploy one or more CRM solution files as well as import data and can even be extended to execute custom code to handle any edge cases while deploying to your CRM org.

Sounds great, so how do we get started?  Well first, you will need to have Visual Studio (2012 or 2013) installed, which we be used to create a package.  Next, download the latest SDK that was released with the Spring ‘14 update which can be found here.  After the SDK is installed, browse to SDK\Templates folder and run the CRMSDKTemplates.vsix to install the necessary Visual Studio Templates.

Now that we have everything setup, we can start to build our deploy package.

  • Open Visual Studio
  • Go to File –> New –> Project
  • Select CRM SDK Templates on the left
  • Select CRM Package Deployment Template and click OK

image

This will create a structure in the Solution Explorer like shown below:

image

The PkgFolder is where you put any CRM Solution files that you would like to be deployed as well as any import data files. 

In my example I have a solution “MySolution1” and “MySolution2” as well as a contacts.csv data import file.

image

Now you can open the ImportConfig.xml and update it with your package files.  At the top of the config file you can also set if you want to install the out-of-the-box sample data as well as if you want to wait for the sample data to install before deploying your package.  There are two agent desktop settings as well that can be used when deploying Unified Service Desk.

In my example I have the package deploying sample data as well as waiting for it to finish before deploying the package.

<configdatastorage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                   installsampledata="true"
                   waitforsampledatatoinstall="true"
                   agentdesktopzipfile=""
                   agentdesktopexename=""
                   crmmigdataimportfile="">

In the solutions node you can define each of your solutions that should be deployed.

<solutions>
    <configsolutionfile solutionpackagefilename="MySolution1.zip" />
    <configsolutionfile solutionpackagefilename="MySolution2.zip" />
</solutions>
 
 

Lastly, you can define any data import files to be imported with the deploy.

<filestoimport>
    <configimportfile filename="contacts.csv" filetype="CSV" associatedmap="" importtoentity="contact" 
                      datadelimiter="" fielddelimiter="comma" enableduplicatedetection="true" isfirstrowheader="true"  
                      isrecordownerateam="false" owneruser="" waitforimporttocomplete="true"/>
</filestoimport>

That’s it for the ImportConfig.xml.  Here is my full config for reference.

<?xml version="1.0" encoding="utf-16"?>
<configdatastorage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                   installsampledata="true"
                   waitforsampledatatoinstall="true"
                   agentdesktopzipfile=""
                       agentdesktopexename=""
                   crmmigdataimportfile="">
  <solutions>
    <configsolutionfile solutionpackagefilename="MySolution1.zip" />
    <configsolutionfile solutionpackagefilename="MySolution2.zip" />
  </solutions>
  <filestoimport>
    <configimportfile filename="contacts.csv" filetype="CSV" associatedmap="" importtoentity="contact" 
                      datadelimiter="" fielddelimiter="comma" enableduplicatedetection="true" isfirstrowheader="true"  
                      isrecordownerateam="false" owneruser="" waitforimporttocomplete="true"/>
  </filestoimport>
</configdatastorage>

 

One last thing to note is that the PkgFolder contains a Content folder with a WelcomeHtml and EndHtml folder.  Within each of those folders are a Default.htm page.  These pages can be customized to your needs to provide a unique welcome and end page during the deploy process.

image

Now you can build the solution in Visual Studio (Build –> Build Solution) which will create a dll that we will use for the Package Deployer Tool.  Go to the bin\Debug folder, copy the PkgFolder as well as the dll named the same as your Visual Studio project and paste them into SDK\Tools\PackageDeployer.

Run the PackageDeployer.exe and a login screen will appear.

image

Select your organization and login.  The next screen will display an iframe showing the content from the WelcomeHtml folder.  As mentioned before, you can customize and brand the html page to suit your needs.

Click Next and you’ll see a screen that lists out the solutions and any files you have included to import.

image

Click Next again and the Package Deployer will attempt to import the included solutions and files.  Once it is finished, it will give you a status on what succeeded or failed.  You will also see another screen showing the content from the EndHtml folder which can be branded and customized as well just like the Welcome screen.

As you can see, the Package Deployer tool is a great asset for administrators and customizers.  It is now easy to make your own branded installation wizard that covers most aspects of the deploy process so you can handle it in one fell swoop. 

Topics: Microsoft Dynamics CRM 2013 Microsoft Dynamics CRM Online