Spotfire Developer Documentation

Examples of building using the Package Builder console

You can use the Spotfire Package Builder console to package DLLs and other files easily into a deployable package file (.spk) or a deployable distribution file (.sdn). This topic contains a few examples of command line entries for different situations.

Example 1: Building a normal package

In this example, a normal package is built, and the following settings and prerequisites are used:

  • The path to the .pkdesc file is: "C:\Folder1\APkdesc.pkdesc".
  • The files listed in the .pkdesc file are located in the folder "C:\Folder1\Folder2" (or in subfolders within it).
  • Assemblies referenced by the assemblies in "C:\Folder1\Folder2" are located in "C:\Folder3" and "C:\Folder4".
  • The cab file inside the .spk file is signed by a local certificate stored in StoreLocation "CurrentUser", StoreName "My", FindType "FindBySubjectName" and CN (Common Name)"A code signing certificate".
  • The url to a timestamp service is: "http://timestampservice.com/sha256/timestamp".
  • The target package will be "C:\Folder5\APackage.spk".

Command line:

Spotfire.Dxp.PackageBuilder-Console.exe /targettype:package /pkdesc:"C:\Folder1\APkdesc.pkdesc" /basefolder:"C:\Folder1\Folder2" /refpath:"C:\Folder3;C:\Folder4" /localcert:"CurrentUser:My:A code signing certificate:FindBySubjectName" /timestamp:"http://timestampservice.com/sha256/timestamp" /target:"C:\Folder5\APackage.spk"

Example 2: Building a normal package with overrides

In this example, a normal package is built using the same settings and prerequisites as in Example 1, but there are also the following overrides:

  • Override package version with the value "1.2.3.4".
  • Override the package name with the name "My new package".
  • Override the package id with the GUID "44824206-FFBB-408A-9A1F-A8ABD203437E".

Command line:

Spotfire.Dxp.PackageBuilder-Console.exe /targettype:package /pkdesc:"C:\Folder1\APkdesc.pkdesc" /basefolder:"C:\Folder1\Folder2" /refpath:"C:\Folder3;C:\Folder4" /localcert:"CurrentUser:My:A code signing certificate:FindBySubjectName" /timestamp:"http://timestampservice.com/sha256/timestamp" /target:"C:\Folder5\APackage.spk" /packageversion:"1.2.3.4" /name:"My new package" /id:"44824206-FFBB-408A-9A1F-A8ABD203437E"

Example 3: Building a package for Linux based on a pkdesc file that has Windows as the default IntendedPlatform

In this example, assume that the PackageDescription tag has the element IntendedPlatform either set to "Windows" or is unspecified. Also, assume that there is an AlternativeId tag specified to "Linux". To build for Linux, without changing anything else, simply set the switch /intendedplatform to "linux". See also Building packages that work with the Web Player on Linux

Command line:

Spotfire.Dxp.PackageBuilder-Console.exe /targettype:package /pkdesc:"C:\Folder1\APkdesc.pkdesc" /basefolder:"C:\Folder1\Folder2" /refpath:"C:\Folder3;C:\Folder4" /localcert:"CurrentUser:My:A code signing certificate:FindBySubjectName" /timestamp:"http://timestampservice.com/sha256/timestamp" /target:"C:\Folder5\APackage.spk" /intendedplatform:linux

Example 4: Signing or resigning an existing package

In this example, a normal package is built using the following settings and prerequisites:

  • The target package is "C:\Folder5\APackage.spk".
  • The cab file inside the spk file is signed by a local certificate stored in StoreLocation "LocalMachine", StoreName "TrustedPublisher", FindType "FindByThumbprint" and ThumbprintId "f3ef5f85dc02480d1a0c4a4949405a06d9d9b5ff".
  • The url to a timestamp service is: "http://timestampservice.com/sha256/timestamp".

Command line:

Spotfire.Dxp.PackageBuilder-Console.exe /targettype:package /localcert:"LocalMachine:TrustedPublisher:f3ef5f85dc02480d1a0c4a4949405a06d9d9b5ff:FindByThumbprint" /timestamp:"http://timestampservice.com/sha256/timestamp" /target:"C:\Folder5\APackage.spk"

Example 5: Building a distribution

In this example, a distribution is built using the following settings and prerequisites:

  • The distribution description file is "C:\Folder1\ADistdesc.xml".
  • The spk files listed in the distribution description file are located in the folder "C:\Folder5".
  • Apply maximum zip-compression to the .sdn file.
  • The same cert and timestamp service as in Example 1 is used.
  • The target distribution will be "C:\Folder5\ADistribution.sdn".

Command line:

Spotfire.Dxp.PackageBuilder-Console.exe /targettype:distribution /distdesc:"C:\Folder1\ADistdesc.xml" /zipcompressionlevel:Optimal /localcert:"CurrentUser:My:A code signing certificate:FindBySubjectName" /timestamp:"http://timestampservice.com/sha256/timestamp" /target:"C:\Folder5\ADistribution.sdn" 

Example 6: Building a visualization mod file

In this example, a .mod file is built from a mod project without signing the file:

  • The target type is "mod".
  • The manifest file for the mod project (specified with the argument /mod-manifest) is "D:\Mods\Examples\my-mod\src\mod-manifest.json".
  • The target (the .mod file) is "D:\Mods\Examples\mods\my-mod.mod".

Command line:

.\Spotfire.Dxp.PackageBuilder-Console.exe /targettype:mod /mod-manifest:"D:\Mods\Examples\my-mod\src\mod-manifest.json" /target:"D:\Mods\Examples\mods\my-mod.mod"

For an example of how to build a signed .mod file, see Signing a visualization mod using Package Builder.