Customizing License Manager

The License Manager encryption key data and interface can be customized to help you better manage your license files. License Manager comes with a default profile, which includes two files located at %PUBLIC%\Documents\SoftwareKey\Protection PLUS 5\License Manager in Windows Vista and later.  The first file is LicenseManagerProfile.xml, which initially contains sample encryption key data meant for evaluation and testing purposes only.  Never distribute production applications that use the sample/test envelope data! Before releasing your applications, you must request and use your own encryption key data. The second file is the GridFieldLayout.xml file, which includes license file field/schema descriptions.

Creating a custom profile

If you are managing products from different companies or departments, or if you have multiple SOLO Server author accounts (each of which will have different encryption key data), you would need to create and manage multiple License Manager profiles. You can also have a profile with customized license fields and descriptions. Before you begin configuring a new profile to use production encryption key data, you should first activate using your primary/default profile.  Otherwise, you may need to activate each profile separately.

Setting up a new profile

  1. Create a new directory/folder for your profile and copy the LicenseManagerProfile.xml and GriedFieldLayout.xml files into this new directory. For the purposes of this example, we will name this new directory so it matches the new example profile's name: Sample Name. We will create this folder under the default profile path: %PUBLIC%\Documents\SoftwareKey\Protection PLUS 5\License Manager\Sample Name.
  2. Browse to where the License Manager shortcut is (this should be located in %ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\SoftwareKey Licensing System\Protection PLUS 5), make a copy of the shortcut, and name the new shortcut so it contains the new profile name. (License Manager (Sample Name).lnk for the example shown here.)
  3. Right-click on your new shortcut, click Properties, go click in the "Target" field, and add the resourcePath switch and the full path to the new folder you created to the end of it's current value.  In this example, we will add the following to the end:
    /resourcepath "%PUBLIC%\Documents\SoftwareKey\Protection PLUS 5\License Manager\Sample Name"

With this set, you can now go to your start screen or menu and click on your new shortcut.  (You may need to type License Manager at the start screen or menu to find the new shortcut.) This will launch License Manager with your new profile, which you can configure using the Tools / Options menu to set your alternate encryption key data, profile name, etc.

To make sure you know which profile is currently being used, click the Tools / Options menu, and set the profile name. This name will appear in the title bar of License Manager. The profile name may only be configured when using the /resourcePath switch to use a different profile.

Changing the Field descriptions

Whenever you click on a license field in the License Manager interface, it lists a description at the bottom of the window. You can customize the description of each field to better describe your particular use of that field. This can be especially useful when training new employees to use License Manager and better understand the values that they are setting.

To change this description, edit the GridFieldLayout.xml file you copied into :"%PUBLIC%\Documents\SoftwareKey\Protection PLUS 5\License Manager\Sample Name" (see above for setting up a new profile). You can change the description for a particular field by editing the text inside the <HelpString> tag for that <Field>:

XML
<Field>
<XPath>/SoftwareKey/PrivateData/License/ProductID</XPath>
<Type>Int</Type>
<Min>0</Min>
<Required>True</Required>
<HelpString>Change this to your own description.</HelpString>
</Field>
Important

You should only consider making any changes to GridFieldLayout.xml if you are comfortable with XML.

While you can add new, custom fields, you should never delete anything. Additionally, you may only modify the HelpString when editing existing/standard fields (altering anything else will break compatibility with Protection PLUS 5 SDK). Any customizations cannot be officially supported, and could have the potential to be incompatible with future versions of License Manager and Protection PLUS 5 SDK. As always, we recommend keeping back-ups of your GridFieldLayout.xml file(s) if you do make any additions (keeping track of changes using a Version Control System is an ideal way to do this).

Adding custom fields

It is possible to add custom fields to License Manager, which will then be available in the license files. This brief guide will use the SimpleTextEditor sample from the PLUSManaged API to demonstrate how this functionality can be used for feature-based licensing.

The SimpleTextEditor sample has the following menu options that can be enabled or disabled: New, Open, Save, Save As, Print, Select All, Cut, Copy, Paste, Find, Replace. The license file needs to contain data that the application will read so it knows whether to enable or disable these features. The SimpleTextEditor sample is configured to enable/disable the menu option based on the LicenseCustomData field using a block of custom XML. The following would disable all menu options:

XML
<SampleLicenseSettings>
<SimpleTextEditorOptions>
<LicenseOptionNew>False</LicenseOptionNew>
<LicenseOptionOpen>False</LicenseOptionOpen>
<LicenseOptionSave>False</LicenseOptionSave>
<LicenseOptionSaveAs>False</LicenseOptionSaveAs>
<LicenseOptionPrint>False</LicenseOptionPrint>
<LicenseOptionSelectAll>False</LicenseOptionSelectAll>
<LicenseOptionCut>False</LicenseOptionCut>
<LicenseOptionCopy>False</LicenseOptionCopy>
<LicenseOptionPaste>False</LicenseOptionPaste>
<LicenseOptionFind>False</LicenseOptionFind>
<LicenseOptionReplace>False</LicenseOptionReplace>
</SimpleTextEditorOptions>
</SampleLicenseSettings>

Updating or modifying the XML directly is not ideal, as the text box does not format the XML.

To address this, you can add custom fields for each feature into the License Manager interface. These fields will use the same XPaths as the data in the LicenseCustomData field, and will make it easier to set individual features as opposed to editing the XML directly.

To add the custom Menu Features category and LicenseOption* fields to License Manager, make the following additions to GridFieldLayout.xml after the License category and before the User-Defined Dates category:

XML
<!-- Custom Fields -->
<Field>
<Name>Menu Features</Name>
<Type>Category</Type>
<HelpString>Menu features for the SimpleTextEditor PLUSManaged sample.</HelpString>
</Field>
<Field>
<XPath>/SoftwareKey/PrivateData/License/LicenseCustomData/SampleLicenseSettings/SimpleTextEditorOptions/LicenseOptionNew</XPath>
<Category>Menu Features</Category>
<Type>Bool</Type>
<HelpString>Enable or disable the New menu option.</HelpString>
</Field>
<!-- Create similar entries for each menu option -->

Once you save the license file, the SimpleTextEditor sample will read this license file and enable/disable features accordingly.