(The download contains a Word document and a PDF document for this same documentation) You can watch the License IT Intro Movie on YouTube at: https://www.youtube.com/watch?v=BycOw5KPCr4 Licensing made simple for C# and other .Net Developers User’s Guide & Technical Specification Introduction
License IT is a licensing system designed specifically for .Net developers to make it easy and affordable to license your Windows, WPF, Web and Mobile applications. License IT is ideally suited for any person or company that wants to license their software or application and can be implemented in about 15 minutes for most applications (WPF Applications involve a few extra steps).
The best part of License IT is that it the prices start at only $50 which is a small fraction compared to some of high end licensing systems that start at $1,000 and some I have looked at cost more than my car.
License IT consists of the following components:
LicenseIT.dll This is the core component of License IT and is used to create and validate licenses. The main components of LicenseIT.dll are:
Namespace: LicenseIT
This class uses a ProductLicenseInformation object to create and validate licenses for a specific product.
Namespace: LicenseIT.Configuration
This object contains all of the information required to create and validate a license for a specific product.
Namespace: LicenseIT.UI.Controls
These are Windows User Controls used to show the days remaining in a trial and can be hosted in Windows or WPF applications and controls.
Namespace: LicenseIT.UI.Forms This form is used to enable the user to begin or continue a trial, or to unlock a trial by entering a purchased license key.
The License Display Controls and the Trial Form contain link buttons that can be configured to link to your website to purchase the full version of your software
Namespace: LicenseIT.Util
This class encapsulates most of the work for implementing a License IT setup in your client application. The two main methods are listed below: LoadLicenseInfo()
This method is used to load the ProductLicenseInformation object for your application by loading the application constants, application configuration data and verified against the currently running application name & Guid.
HandleLicense()
This method is called by your application at startup to check for the existence of a license, and to check if a trial is allowed to be started or continued.
License IT Admin This is a Windows application that allows you to select, create and manage ProductLicenseInformation objects, also known as Products or LicenseInfo objects.
The License IT Admin program is also used to create license keys for your customers.
Read the Getting Started Guide later in this document for more information about using the LicenseIT Admin program.
LicenseIT.ObjectLibary
This class contains objects that are used by LicenseIT.dll to verify that you have a valid license and to verify the ProductCategory (Trial, Basic, Standard, Pro or Enterprise).
The two main features in this object are listed below:
Namespace: LicenseIT.ObjectLibrary.BusinessObjects
This class is used to grant your application permission to run.
Namespace: LicenseIT.ObjectLibrary.Enumerations This enumeration contains four product categories (Trial, Standard, Pro or Enterprise). In combination with the IsTrial option, there is actually a fifth product category by setting the value of License Type to ‘Licensed’ and then selecting the Product Category of Trial, a different license key is created so a Basic (or limited) license can be created.
You can use the License.ProductCategory to restrict or unlock features / transaction limits for higher end licenses (hence charge more for the ‘premium’ versions).
At the time of this writing, you must include the LicenesIT.dll, LicenseIT.ObjectLibrary.dll and the following two components must be installed with your application:
DataJuggler.Core.UltimateHelper
This project was just released on CodePlex at http://ultimatehelper.codeplex.com. This class contains many helper classes I have created over the years and I am asking other developers to contribute their favorites. The goal is to cut down on the number of classes I have to add to new projects and reuse existing libraries.
DataJuggler.WinControls
This is another project by Data Juggler Software and added to the Data Juggler Controls open source project (http://datajugglercontrols.codeplex.com – which now contains the Data Juggler Web Controls, Data Juggler Win Controls and Data Juggler WPF Controls.
I purposely did not embed these controls inside of the LicenseIT.dll to make it easy for you to reuse these projects if desired.
Please send any feedback on if a one .dll approach is of that much value to you and perhaps future releases will require only a single runtime .dll to be included in your client apps.
License IT Web Service
The License IT Web Service is currently live, and I am using the Web Service to handle the licensing forwww.countwidget.com , another open source project that was just released athttp://countwidget.codeplex.com .
The Web Service contains methods for generating, validating and activating license keys.
While these services are working, to be commercially stable requires more testing and I would request any brave beta testers to send me an email atsupport@datajuggler.com and a free year of the web service could be offered in exchange for your feedback.
The License IT Web Service (once available) will be an additional charge of $10 per month per 1000 transactions; or roughly one penny per software activation, validation, or license creation via the web service. Additional transactions will be charged one cent each.
Sample Projects
There are two sample projects included in the LicenseIT installation folder:
Both of the sample projects are actually open source projects of Data Juggler Software that do not require a license, but a license was added to them to demonstrate License IT.
A link to each of these projects is shown below, as the samples may not be updated:
Win Sample – DB Compare: http://dbcompare.codeplex.com
WPF Sample – Engine Wars Chess Client: http://enginewars.codeplex.com Getting Started Guide
The first step is to launch the License IT Admin program, which will launch the Trial Form.
Enter your email address and click the ‘Get Trial Code’ button.
This will generate your license and license key and you can begin your evaluation period:
This is the same screen your customers will see, although you can pass in your own image if you choose to by calling the SetBackgroundImage(image) method. The Purchase Full Version link comes from your app.config file and is created when you click the ‘Create Config Values’ button on the Product Configuration Editor Form.
Creating Your First Project
Once you click the Begin Trial button this will launch License IT for the first time:
In the image above there is not a product selected, so you must create a new product which should only take a few minutes to setup. Click the ‘New Product’ button which will launch the License IT Configuration Manager:
The screenshot above is actually in ‘Edit Mode’ as you will notice the Product Name field is not editable as the product name cannot be changed once a product has been created. The product name is actually the name of your application, which in Visual Studio can be derived by selecting your application in the solution explorer, and from the context menu select ‘Properties’. Once the solution properties has launched, click the ‘Assembly Information’ button:
The Title and the Product Guid come from your application, and must match exactly or your license will not validate. This does not make it impossible for someone to bypass a license, but it does make it harder. If your application does not have a GUID, create one; if you do not know how to create a GUID Google ‘Online GUID Generator’. App Friendly Name
One field not listed on the configuration editor form is called the AppFriendlyName. You can add an extra app setting value to the app.config file for ‘AppFriendlyName’ (shown below) and this will change the name that is displayed in dialogs and by the License Display Controls and the Trial Form. <add key="AppFriendlyName" value="Engine Wars Chess Client"/> Security Token The SecurityToken is a file that is installed on a client system when the user creates a trial license. This file is encrypted and contains the date that your product was installed. You can choose any filename you wish, but it is recommended to make the file look like a system file, or something that a user would not be likely to delete if a user found it and didn’t know what it is. $System$ is a shortcut that corresponds to c:\Windows\System32.
Product Password This password is used to encrypt values that are used internally to create your app settings values and your application constants. Product key This is an encryption key that is used to encrypt values as an extra layer of security as many fields are encrypted multiple times with different password keys. Characters Per Set This determines the number of characters to place in each set; the default value is 5. License Sets This determines the number of sets containing the characters per set value above. The default value for License Sets is 5. An example key containing 5 sets of 5 characters per set: EX91Z-CYMVB-FAGHJ-UAXXC-YZFXH Access Key The Access Key is an additional measure of protection that takes the values from specific app settings values and randomly scrambles the data so that the name of the app setting does not ensure that the value will be in that field. These values can only be retrieved using the Access Key, which is a constant in your application. You should only click the ‘New’ button to create an Access Key the first time you create a product. Changing the Access Token will require you to recreate the App Settings Values and the App Constants and will cause your existing clients to stop working. Product Categories Product Categories are a way for you to limit features or unlock features for higher end versions of your product. License IT Admin Features: The following table demonstrates the types of licenses you can create based upon the product category of the License IT Admin license you have purchased:
The prices are also very affordable:
The Enterprise version also includes one year of 1000 transactions per month of the License IT Web Service (once the service is available). The product categories in License IT Admin are very straight forward; you can create License Keys up to the level you have purchased. If you only need Trial and Standard licenses than you should purchase the Standard version of License IT Admin. In your own applications you can restrict features to suit the needs of your product. One important thing to note about License IT licensing and product categories is the simplest thing for someone to do is remove the security token, since a search for recently modified files after an installation will list the security token. It is recommended to restrict certain features to only ‘Licensed’ copies (License Type of Licensed, versus Trial). This way even if the security token is deleted, a continuous trial would only result in limited features being available to non-licensed customers. If you were paying attention I just told you how to extend past the trial in License IT Admin, but this is a violation of our license agreement, and this doesn’t allow you to create licensed versions of your license keys; you must have a licensed copy to create a product category other than a trial. Also note that only the License IT Admin program can create licenses, so the installed copies of LicenseIT.dll on your client’s machine are not able to create licenses (without a great deal of difficulty, as I know the security algorithms and it took me a long time to create a license manually). For testing purposes during your trial, you can create a license key that is of License Type ‘Licensed’, using the only available product category of ‘Trial’. The license key generated from product category = ‘Trial’ and License Type = ‘Licensed’ is different than the LicenseKey generated from product category = ‘Trial’ and License Type = ‘Trial’. You can refer to a Licensed version of Product Category = ‘Trial’ as a Basic product category, with less features available in your software than a Standard (or Full Version). Purchase Information The purchase information is used by the License Display Controls and Trial Form to send the user to your web page (or a payment processor) and to correctly show dialog boxes for your application and support contact information. Set As Default It is recommended to save your product, and then edit your product before clicking ‘Set as Default’. There seems to be a sporadic bug in the way the products are stored internally and an update is performed and if the product is not saved yet the Set as Default does not take. Delete You can delete a Product, but be warned, this is permanent. Create Config Values After you have created and saved your product, clicking this button will copy the app setting values to your clipboard. Copy and paste these values to your app.config file in the App Settings section. If your application does not have an app.config file, create one at the root of your application and look at the Win Sample, located in the Samples directory to see an example. Create App Constants Clicking this button will create the three required constants for you to paste into the main form (or Window for WPF) of your application. The three constants are:
The Scrambler takes your Product Key and encrypts it using your Product Guid.
The AccessToken is a combination of your Product Name and then encrypted by your Product Key and Scrambler and some internal values used by License IT.
This encrypted value instructs License IT how to unscramble the fields that are stored in the app.config file.
Paste the copied values into your main form of your application as you will need them to call the LicenseIT.ClientHelper.HandleLicense() method and to setup your License Display Controls if you use any. Save Clicking the ‘Save’ button will validate and then save your Product License Information object. If there are any validation errors you will be shown a message. It is strongly recommended you save a copy of all of the values of your product license information as if anything were to happen to the values stored within the License IT Admin program they would not be recoverable. I use a password protected Excel spreadsheet, but anywhere is better than not at all. You have been warned. Cancel – click this when finished.
Setting Up Your Project in Visual Studio License IT can be added to both Visual Studio 2010 and 2012 projects. Create the License Data In your project folder, open the bin\debug\ folder and create a folder called Data. You can copy the values from either of the sample projects. Open the file License.xml in Visual Studio and edit the license name to reflect your project as shown in this picture:
In the above example, you would replace DBCompare with your Product Name. This will not be the same for deployment, but I always create a Backup copy of a ‘Pristine’ license so that I can erase it to test the process of creating licenses. Windows Application Setup As described in the Product Editor section above, clicking the Create Config Values button will create the App Settings values that are required to be in your application. Below is a snapshot of the App.config from the sample project DB Compare located in the Win Sample folder. Configuration Values
Application Constants
Using Statements
Notice the LIT reference to LicenseIT.ObjectLibrary.BusinessObjects. This is because of a conflict with System.ComponentModel.License. Storing the License You do not have to store a copy of the current license in memory, you can load it as needed, but I prefer to load the license as a public property so anywhere on the form I can refer to this.License and then to get information about the License:
HandleLicense() It is up to you to determine the best place in your application to implement the call to the HandleLicense() method of the LicenseITClientHelper class. The sample project DB Compare uses Program.cs and this is my preferred location. The code below is an example of the from Program.cs Main() method:
(Continued Next Page)
One thing to note is LicenseITManager.GetProductDisplayName() method; this method will return the AppFriendlyName if present, else the Product Name is returned. DB Compare uses the Horizontal License Display Control, which by default uses the theme ‘Trial Background’ so a call to SetBackgroundImage(theme) is not shown. Themes There are six themes available, and they are listed here:
In addition to Themes you can also pass in your image in an override to SetBackgroundImage(image) or you can call SetBackgroundColor(color).
One last thing to note about the DB Compare sample and the Engine Wars WPF Sample is that I did not implement any “crippling” features for the Trial Version. As I have previously mentioned, these projects are open source so they do not actually have a license. In your own applications you can decide what features should be included in specific versions of your product. WPF Sample Perhaps it is that I have 12 more years’ experience with Windows development than WPF development, but I find everything to take longer in WPF. License IT is no exception to this as there is a little more work to host a License Display Control in WPF. WPF requires the use of a WindowsFormHost control to be able to host the Windows Form User Control. The Engine Wars sample demonstrates the use of the HorizontalLicenseDisplayControl being hosted inside of a WindowsFormHost control. The code below shows the GameView_Loaded event where the control is added:
In the above example, if the License is a trial, the HorizontalLicenseDislayControl is added to the WindowsFormsHost control as shown in the SetupLicenseControl() method:
The Engine Wars sample uses the DeepOrange theme. Deployment The folder ‘Data’ and the file License.xml must be installed to the application folder.
Frequently Asked Questions: Q: Can License IT be used with VB.Net? A: Yes; I have never done it, but the only change required is the App Constants are created in C#, so you would need to convert the constant values to VB.net syntax. _________________________________________________________________________ Q: Can a license be installed on more than one machine? A: Yes; I know how to restrict a license to only the current machine id, but doing so makes for unhappy customers. In a previous product in the past I had this restriction and the support required was increased, the customers complained and as a consumer I am not happy about a product that cannot be installed on my second development machine. As a developer, sometimes my machine is running a process that takes a long time and I do not like the lack of freedom from being able to choose which machine I can work on due to a license. I guess it is the libertarian in me, but freedom is always best. _________________________________________________________________________ Q: I noticed your license requires an Email Address, what if people do not want to share their Email Address? A: I started to create the Email Address as an option, but the more I thought about it the more I wanted the Email Address requirement. The reason is people are less likely to share something they purchased, if they know that something is identifiable back to them. _________________________________________________________________________ Q: You said the License IT Web Service would be live soon, what does the License IT Web Service do that License IT Admin doesn’t do? A: The web service contains methods for Activating, Generating and Validating licenses over the internet. Once this is fully implemented you will be able to add features such as:Require Activation or Validate License Key to further restrict access to your application to customers who have purchased a valid license. _________________________________________________________________________ Q: When will the Web Service be available? A: It is live now and running, so once the testing and documentation is complete it will be released. The first request for the Web Service from a paying customer will expedite the process. The Target date is early summer, perhaps sooner but Count Widget was put on hold to finish License IT due to a customer requested License IT. _________________________________________________________________________ Q: Is support available? A: Yes, send questions to support@datajuggler.com and you should receive an answer with 1 to 2 days depending on the question difficulty and number of questions. _________________________________________________________________________
This FAQ will be updated with more questions as License IT evolves. |