The Simple Text Editor Sample focuses on demonstrating feature-based licensing using custom parameters. There are multiple ways to configure custom license data in SOLO Server, including user-defined fields, custom parameter sets, and custom developed pages (see our Customizing License Data video for more details). This tutorial will demonstrate all of these approaches, as well as how to activate, refresh, and deactivate a license.
This tutorial can use the SimpleTextEditor ReadOnlyLicense, SimpleTextEditor SelfSignedLicense, or SimpleTextEditor SelfSignedTrial sample project. There will be differences in the license and feature statuses since the SelfSigned samples start up as an evaluation/trial with all features enabled, but the other functionality is the same.
Open the PLUSManagedSamples *.sln file corresponding to your version of Visual Studio. The Samples directory can be opened by running Protection PLUS 5 SDK from your start menu/screen, and clicking on the Sample Projects button. You may then unzip the samples to a folder of your choosing.
Once the project has loaded in Visual Studio, expand the programming language you wish to proceed with (C# or VB.NET).
Expand the Windows.Forms folder and PLUSManaged folder. Locate the SimpleTextEditorReadOnly Sample.
Right-click this sample and select Debug > Start New Instance.
Alternatively, the SimpleTextEditorSelfSigned sample or the SimpleTextEditorSelfSignedTrial sample may be run instead.
Upon launching, the Simple Text Editor will show the current license status along with the features that are enabled or disabled. To activate the application automatically using SOLO Server, click Activate Online. A new dialog will prompt for a License ID and Activation Password (both are required).
The screenshot below reflects the status from the ReadOnlyLicense sample or the SelfSignedLicense sample.
The screenshot below reflects the status from the SelfSigned or SelfSignedTrial Sample. The license status is an evaluation/trial and all features are enabled until the evaluation has expired. The user can still activate with a license at any time.
For ease of use, all of the Protection PLUS 5 SDK sample applications use a generic Test Author account with its own Encryption Key ID. We will use this Test Author account on SOLO Server to generate the License ID and Activation Password necessary to activate the Simple Text Editor Sample.
To log into SOLO Server, use the Test Author credentials:
Once logged in, go to the menu Configure / Products.
The Product List page will show all of the products available to the Test Author. Expand "Show Options" beside the Simple Text Editor Sample product. The Option Details show different Product Options (license types) for activating the Simple Text Editor Sample application. This is where predefined license settings and data can be configured for each Option.
For this tutorial, we will not be adjusting any Option settings, but we will generate a license from theFull License Option. To create Products and Options on your own SOLO Server account, refer to the Product Configuration topic.
To add a test license, go to the menu Customers / Add Test License.
Select Simple Text Editor Sample Full License and click Add New Test License.
On the Add Test License page, do not change the default values and click Add License.
Test Licenses are meant for software development integration and testing purposes ONLY and should never be sent to a real customer. Test Licenses are DELETED from the license database on the first day of every month.
The test license has now been created based on the Simple Text Editor Sample Full License Product Option settings and attached to a new, unregistered customer record.
Click on the License ID in the Licenses & Other Items section to load the License Details page.
The license has a unique License ID and Activation Password. Keep track of this License ID, as it will be used throughout the rest of this tutorial.
In the Simple Text Editor License Parameters section, there is a list of parameters, which was assigned in the Product Option setting using a Custom Parameter Set. A custom parameter set makes it easier to set and update custom license data, and that data is then serialized to XML and stored in the License CustomData field.
In the Simple Text Editor Sample application, the custom parameters are being used to enable or disable the use of menu options and buttons. By default, this particular custom parameter set is configured to enable all the parameters except for Print, Find and Replace.
Return to the Simple Text Editor Sample and click Activate Online. Enter the License ID and Activation Password in their respective fields and, optionally, an Installation Name. Specifying an installation name is optional, but helpful when performing multiple installations for different machines and/or users.
Click Activate to perform an online activation with SOLO Server.
Upon successful activation, a confirmation dialog is shown. If the activation fails, please verify the information entered with the license details in SOLO Server.
The License Status will now show as OK, as the menu options will be enabled based on the CustomData values.
You will see that the Print menu option and button are disabled in Simple Text Editor.
This same concept can be applied to any feature or functionality in your own application.
License data can be updated in SOLO Server, and then an activated device can perform a license Refresh to get that updated data. We will demonstrate updating values through the customer parameter set, a custom developed page, and through user-defined fields. See our Customizing License Data video for more details on each approach.
To make changes to the custom parameter set values, go to the License Details page of the license you added earlier and use the drop-down Actions: License / Edit.
At the bottom of the Edit License page, enable the File/Print Menu Enabled option.
You can preview the License Custom Data XML, which is what the licensed application will be reading from the local license file.
Click the Submit button.
Return to the Simple Text Editor Sample and use the menu Help / About to reprompt the license dialog, then click Refresh License. Alternatively, just use the menu Help / Refresh License.
When the license successfully refreshes, the features will show their updated status, and access to the Print menu/button option will be available.
An alternative to a custom parameter set is a custom developed Edit Custom License Parameters page. The custom page can support custom parameters as well as custom business logic, which gives you more control compared to a custom parameter set. A customized page can be added to your SOLO Server account using our professional services.
On the License Details page, locate the Custom License Options section and click the Edit Simple Text Editor License Options button.
To enable or disable certain features, check or uncheck the corresponding boxes. Note that the Save As field requires that Save be enabled, and the Replace field require that Find be enabled. Any custom logic could be implemented for your own custom page.
In this case, these values are serialized to XML in the same way as the custom parameter set approach.
Enable all the menu options, then click the Save button.
Return to the Simple Text Editor Sample and use the menu Help / About to reprompt the license dialog, then click Refresh License. Alternatively, just use the menu Help / Refresh License.
When the license successfully refreshes, the features will show their updated status, and access to all the features will now be available in the Simple Text Editor application.
If you only need a limited number of fields for your custom data, and you also want to be able to search for that data in SOLO Server, you can use the included user-defined fields. These fields must be manually updated when using our standard functionality; they are not set automatically when a new license is created.
At the bottom of the License Details page, click the User-Defined Fields tab, and then click the Edit button.
Custom labels can be assigned to each field, but no additional fields can be added. All the fields are included in the license file. For this example, we will only be updating the Legacy License Key (UserDefinedString1) field.
Input any value and then click Submit.
Return to the Simple Text Editor Sample and use the menu Help / About to reprompt the license dialog, then click Refresh License.
When the license successfully refreshes, you will see the legacy serial value in the license dialog, but this value could be used or displayed anywhere.
Deactivating an installation disables use of the software on that device, and increments the Activations Left count of the License ID in SOLO Server, which allows the user to activate the software on a different device. The License ID also has a Deactivations Left count, which allows you to limit the number of times a customer can deactivate and transfer a license.
The Simple Text Editor Sample Full License Product Option is configured to start with one Activation Left and one Deactivation Left. After activating in Step 2, the License ID you are using should not have any Activations Left.
To deactivate, bring up the License Status dialog of the Simple Text Editor by going to the menu Help / About.
Once the License Status dialog appears, click the Deactivate button.
A confirmation will appear if the license was successfully deactivated.
The screenshot below reflects the status from the ReadOnlyLicense sample. The SelfSigned sample will have a status of "9203: License invalid or expired."
The screenshot below reflects the status from the SelfSignedTrial Sample. When the license is deactivated, it will revert to the evaluation license. If the original evaluation period has not expired, the application features will still be enabled until the evaluation expires.
In SOLO Server, this License ID will now have one Activation Left and zero Deactivations Left, which allows the user to activate one more time on a different computer. You can manually update the number of Activations or Deactivations on the License Details page in SOLO Server.
An installation can also be remotely deactivated through SOLO Server.
A manual activation allows you to activate a computer that does not have an Internet connection. It will create an activation request that must be transferred to another device that does have an Internet connection. The request can be a string or a file.
If you previously activated this sample application, but have not deactivated yet, please complete Step 4 before continuing.
To bring up the License Status dialog of the Simple Text Editor, go to the menu Help / About. You should see the message: "License not found – activation is required":
Click Activate Manually to proceed with testing a manual activation. A manual activation allows for activations through another computer that does have an Internet connection.
Return to SOLO Server using the Test Author account. Use the Search menu to find the License ID you previously used to activate online. If you no longer have this number, you can create a new License ID as shown in Step 2.
Return to the Activate Manually dialog for our Simple Text Editor Sample. Enter the License ID and Activation Password in their respective fields and click Generate Request.
This dialog will generate an encrypted activation request to be processed by SOLO Server. Click the Save Activation Request File button and save the file to a location on your hard drive. The file will save as an html format file. Normally, the user would then copy this file to a computer with Internet access, but for this tutorial just double-click the file. Your browser will open to the License Portal. This web page is accessible from any computer with access to the Internet.
The License Portal will now generate an encrypted response. Click the Download button and save the response file to a location on your computer.
Again, normally a user would copy this activation response file back to the computer to activate.
Return to the activation window and click the Open Activation Response File button. Browse to the response file you saved in the previous step and open it. Click Activate.
Upon successful activation, a confirmation dialog is shown. If the activation fails, please verify the information entered with the license details on SOLO Server.
The License Status will now show as OK along with any features enabled or disabled based on the custom data.