Deploying DSS Services

Glossary Item Box

DSS User Guide: DSS Service Deployment Alternatives

.NET Framework Developer's Guide: Strong-Named AssembliesDelay Signing an Assembly

See Also Microsoft Robotics Developer Studio Send feedback on this topic

Deploying DSS Services

The DSS Deploy Tool (DssDeploy.exe) utility can create and unpack self-extracting archives for deploying service implementations across nodes and for distributing services to other parties. Deploy packages are tailored for service deployment and contain everything needed for services to be executed on another node or machine and can contain binaries, source code, and documentation. This enables deploy packages to be used for internal deployment of service implementations. For example, deployment to an autonomous robot, as well as for distributing and sharing service implementations with other parties. For example, by making deploy packages available for download over the Web.

Creating a Deploy Package

The basic mode for creating a Deploy package is by using DSS Deploy Tool (DssDeploy.exe) from a DSS command prompt using the /p command line option for creating the package together with the resulting package name:

dssdeploy /p [options] Package.exe

The options are used to determine the contents and behavior of the deploy package as described below:

Specifying Services and Other Content to Deploy

A deploy package can contain one or more service implementations specified using one or more manifests, contract identifiers, and/or service assemblies passed as command line parameters to DSS Deploy Tool (DssDeploy.exe). Based on a dependency analysis of these input parameters DSS Deploy Tool (DssDeploy.exe) determines the set of files to include in the package. For example, when run from a DSS command prompt the following example creates an archive called, ServiceTutorial1.exe, containing everything necessary to run ServiceTutorial1 based on the manifest provided on the command line:

dssdeploy /p /m:"samples\config\ServiceTutorial1.manifest.xml" ServiceTutorial1.exe

By specifying multiple manifests, contract identifiers, and/or service assemblies, the programmer can create deploy packages containing multiple independent services. For example, the following command line creates an archive called, ServiceTutorial1-2.exe, containing everything necessary to run both ServiceTutorial1 and ServiceTutorial2:

dssdeploy /p /m:"samples\Config\ServiceTutorial1.manifest.xml" /m:"samples\Config\ServiceTutorial2.manifest.xml" ServiceTutorials1-2.exe

Files that are not included in the dependency analysis can be added explicitly using one ore more instances of the /d command line option. This can be used to add configuration files, style sheets, documentation, additional binaries, etc. Valid values include individual files, file sets using wildcards, and directories. If the /sub command line option is specified, directories will also include sub-directories. This example creates a package that includes everything within the Store\Styles directory and all its sub-directories:

dssdeploy /p /m:"samples\Config\ServiceTutorial1.manifest.xml" /d:"store\styles" /sub ServiceTutorial1-store.exe
Bb483012.hs-note(en-us,MSDN.10).gif When adding files located under the DSS installation folder, the file hierarchy is preserved within the deploy package. However, files located outside the DSS installation folder will end up in the root folder of the deploy package. 

Controlling File Permissions

When unpacking a deploy package that includes the DSS runtime, the file permissions can be set to limit access to the unpacked files. This prevents that unauthorized users can access or manipulate the contents of a deployed package. By default all unpacked files have the ReadOnly flag enabled and the file permissions set as follows:

Security Principals File Permissions
Administrators Full permission
Power Users Modify permission
Users Read and Execute permission

Using the /s command line option the programmer can indicate if they don't want the file permissions to be set. If permissions are not enabled, the files will have the default permissions controlled by the destination where the files are unpacked. The following example turns setting the file permissions off for the package:

dssdeploy /p /s- /m:"samples\config\ServiceTutorial1.manifest.xml" ServiceTutorial1.exe

Targeting a Specific Runtime

The programmer has the option of controlling which version of DSS runtime to target. By using the /cv command line option the programmer targets the current version being used to generate the Deploy package.

dssdeploy /p /e+ /cv+ /s- /m:"samples\config\ServiceTutorial1.manifest.xml" ServiceTutorial1.exe

Using the /cv command line option requires that DSS is installed on the machine where the package is generated. In some build environments it is useful to be able to create a deploy package without having the full studio installed. In this case the programmer can use the two command line options /dvg and /ddn to provide the same information implicitly provided by the /cv command line option:

Command Line option Short-name Value
/DeployVersionGuid /dvg

Providing Descriptive Package Information

When deploy packages targeting an existing DSS installation are unpacked, an HTML-based package information file is automatically created in the packages sub-directory of the DSS installation directory. The file contains a list of files that are installed as part of the package. The following two command line options can be used to add descriptive information to the file as follows:

Command Line option Short-name Description
/Name /n This parameter provides a descriptive title for the package. The package title is used as the filename of the package information file.
/DescriptionFile /df A plain-text or HTML file containing a description of the package. The description is included in the package information file.

This example creates a deploy package targeting a Microsoft Robotics Devleoper Studio installation filling in information for the descriptive package information file using the /n and /df command line parameters:

dssdeploy /p /e+ /cv+ /s- /m:"samples\config\ServiceTutorial1.manifest.xml" /n:"Service Tutorial 1 deploy package" /df:"documentation\sample.htm" ServiceTutorial1.exe

Adding a README File

Using the /r command line option you can specify a README file to launch after the unpacking has completed. The README file is typically an HTML file launched within a conventional Web browser. This example shows how to specify a README file so that it is launched when the package has been unpacked.

dssdeploy /p /m:"samples\config\ServiceTutorial1.manifest.xml" /r:"documentation\sample.htm" ServiceTutorial1.exe
Bb483012.hs-note(en-us,MSDN.10).gif The README file is only shown when the deploy package is being unpacked in Graphical User Interface (GUI) mode (see Unpacking a Deploy Package)

Using the /l command line option the programmer can specify a license or copyright to be presented to the user unpacking the Deploy package. The user is given the choice of accepting or declining the license and/or copyright. Only if the user accepts the statement, will the package be unpacked.

dssdeploy /p /m:"samples\config\ServiceTutorial1.manifest.xml" /l:"documentation\sample.rtf" ServiceTutorial1.exe
Bb483012.hs-note(en-us,MSDN.10).gif License and copyright files are only shown when the deploy package is being unpacked in GUI mode (see Unpacking a Deploy Package)

Strong-Name Signing a Deploy Package

A self-extracting DSS deploy package is a .NET assembly which means that it can be digitally signed as a .NET strong-named assembly. For the purpose of DSS Deploy packages. A strong-named assembly guarantees two things:

  • Uniqueness: No one can generate the same assembly strong-name because an assembly generated with one private key has a different name than an assembly generated with another private key.

  • Strong integrity check: The .NET Framework security checks ensures that the contents of the assembly has not been changed since the assembly was created.

Bb483012.hs-note(en-us,MSDN.10).gif A strong-named assembly does not imply a level of trust like that provided, for example, by a digital signature and supporting certificate.

Using the /keyfile and /delaysign command line options, a package can be created as a fully strong-name signed assembly or as a delay-signed assembly. The delay-signed assembly can then be fully signed later. The following example shows how to strong-name sign a Deploy package using the strong-name key which is generated as part of a DSS installation.

dssdeploy /p /m:"samples\config\ServiceTutorial1.manifest.xml" /keyfile:"samples\mrisamples.snk" ServiceTutorial1.exe

Unpacking a Deploy Package

A Deploy package can be unpacked either using DSS Deploy Tool (DssDeploy.exe) or by simply executing the self-extracting package directly. If executing the Deploy package without command line parameters, the package starts in Graphical User Interface (GUI) mode where the user can provide required parameters. It is only in GUI mode that any README file, license and/or copyright files are presented to the user.

If a License Agreement was specified when the DssDeploy package was created, then it is displayed first and the user must accept it before proceeding. For example:

Bb483012.DssDeploy-LicenseAgreement(en-us,MSDN.10).png

After the license is accepted (if there is one), a DssDeploy Extractor dialog is displayed. Depending on the options specified when the package was created, the user might be able to change the installation folder or they might not. In the following diagram the user is presented with the option to change the installation folder. In this case the initial default is the folder that the DssDeploy package is run from.

Bb483012.DssDeploy(en-us,MSDN.10).png

The Contents button can be used to view a list of files included in the package. There is no way to select which files will be installed.

The user can click on Cancel to abort the installation. Clicking on OK begins copying the files. However, before DssDeploy overwrites existing files it displays an additional confirmation dialog.

If the package is executed with command line parameters it is started in a command-line only mode. The command line parameter can either be a file path indicating the destination directory of where to unpack the contents or /specific for indicating that it is targeting an existing DSS installation. The latter only applies to packages that have been created to target an existing DSS installation.

Using DSS Deploy Tool (DssDeploy.exe) the basic mode for unpacking a deploy package is by using the /u command line option together with the package name:

dssdeploy /u [options] Package.exe

The /t command line option which can be used to indicate the destination folder of the deploy package although it can only be used with deploy packages that are not targeting an existing DSS installation. The following is an example of how to unpack the ServiceTutorial1.exe Deploy package

dssdeploy /u ServiceTutorial1.exe
See Also 

DSS User Guide: DSS Service Deployment Alternatives

.NET Framework Developer's Guide: Strong-Named AssembliesDelay Signing an Assembly

 

 

© 2012 Microsoft Corporation. All Rights Reserved.