DeployLX Software Protection System

Resources and Addresses

Resources

License Embedded Resources

Use the Resources Editor from either the Easy or Advanced license editors to manage resources embedded in a license file or in each individual license.

When a resource is embedded directly into the license file the size of the license file will grow significantly so it should be reserved for smaller resources such as logos and written license agreements. Larger resources should either be installed locally or as an embedded resource in the protected assembly.

Use the licres:// protocol as described below to reference a resource embedded in the license.

Assembly Embedded Resources

The .NET Framework supports embedding any file directly into an assembly as an embedded resource. You can reference these resources in your license for images on forms or HTML pages for license terms and information.

Use the asmres:// protocol described below to reference a resource embedded in an assembly.

To embed a resource in an assembly

  1. With the assembly project open in Visual Studio .NET select Project | Add Existing Item from the menu.
  2. Open the Properties Window (F4).
  3. Change the Build Action of the selected file to Embedded Resource.

Local Resources

Resources installed in the same folder as the protected assembly can also be addressed directly.

Use the file:// protocol to reference a resource located on the client's machine. The Assembly Folder variable described below can be used to reference the assembly install folder.

file:///{11}/Splash.png

Remote Resources

Resources located on remote web servers can also be used by DeployLX forms. Be careful when using remote resources since the resource will be downloaded each time the form is displayed and can delay the startup of your protected application.

HTML Resources

When you use an HTML resource for one of the text properties, such as the EULA address, of the license it will be displayed in an embedded browser. The HTML resource can reference other images pages using the same address rules form images. For example, if your embedded EULA.html wants to display an image. The image can be embedded in the same assembly and referenced using the asmres:// protocol in the src attribute of the img tag.

Addressing Embedded, Local and Remote Resources

Many of the properties and forms can use resources that have been embedded in a license file or assembly as well as local or remote resources. DeployLX uses standard URLs to address all types of resources and adds two custom protocols for addressing resources embedded in licenses files or assemblies.

Use multiple addresses for each property to provide mirrors for the same resource. To specify more than one address for a single resource, separate each address with a pipe (|) character.

Address Protocols

DeployLX supports downloading resources from online locations using the common HTTP, HTTPS and FTP protocols as well as local resources using the FILE protocol. DeployLX also introduces two custom protocols for accessing resources embedded directly in assemblies or the license file.

licres:// Protocol

licres://license|licensefile/resourcename

This scheme will reference a resource embedded directly into the license. licres://license will reference the currently validating license, licres://licensefile will reference the validating license's file.

asmres:// Protocol

asmres://assemblyname/resourcename

This scheme will load a resource embedded directly into an assembly. assemblyname is the display name of the assembly (such as System.Windows.Forms or DeployLX.Licensing.v5) without version, or other information. resourcename is the fully qualified name of the resource.

If a resource named trial.png is embedded as a resource in the assembly named Widgets with a default namespace of Acme.Widgets the following address will reference that image.

asmres://Widges/Acme.Widgets.trial.png		
Resorces In Project Folders

For C# projects, when you use project folders to organize your resources, Visual Studio will automatically add the name of the folder to the name of the embedded resource. In the example above, if the trial.png file was located in a project folder named Images the address would be

asmres://Widgets/Acme.Widgets.Images.trial.png

Visual Basic .NET projects do not add folder names to the names of embedded resources.

Using Variables in an Address

DeployLX supports replaceable variables in addresses that can be used to point to different resources based on the license or assembly being validated. The address is passed directly to the String.Format method with the following values that can referenced by their index.

{0}

LicenseId

The unique LicenseId of the license currently being validated.

{1}

Serial Number

The serial number of the license currently being validated.

{2}

Serial Number Prefix

The serial number prefix of the license currently being validated. Can often be used at the server to identify the version of the product being validated to return custom information.

{3}

Hardware Profile

Hash of the machine's hardware profile.

{4}

Assembly Name

The display name of the assembly containing the protected class.

{5}

Client Culture

The name of the currently activate culture on the client's machine. Can be used to return culture specific data from a server.

{6}

Product Name

The name of the product being validated. Obtained by the request info provided when validation began.

{7}

Product Version

The version of the product begin validated. Obtained by the request info provided when validation began.

{8}

Manufacturer

The name of the manufacturer included in the request info provided when validation began.

{9}

Support Website

The address of the customer support website included in the request info provided when validation began.

{10}

Assembly Location

The full path to the location where the protected assembly was loaded from. Valid only with the file:// protocol.

{11}

Assembly Folder

The full path to the folder where the protected assembly was loaded from. Can be used to reference locally installed resources in the same folder as the assembly. Valid only with the file:// protocol.

{12}

Registration Info

Each of the registration fields (except the serial number) captured when the license was registered. Each field is expanded to a name=value pair into the resulting url.

See Also