<< Click to Display Table of Contents >> Navigation: License Manager > License Generation > Generating a license |
From the Orders panel, you can generate a license for your protected applications by clicking on the Generate button under the License tab. After that, the next form will be displayed:
Customer's Details
For each license that you generate, you can insert specific customer's information (Name, Company and Custom Data). By default, WinLicense takes the Customer information from the one that you have generated in the WinLicense database. Notice that you can change the Customer Name in the license even if you have a different customer name in the WinLicense database. The user information, Name + Company + Custom Data, can be retrieved in runtime when you call the WinLicense SDK function WLRegGetLicenseInfo.
The "Custom Data" field can contain up to 8000 chars of specific information. Some developers want to put special information in the Custom Data field, for example, they encode a value that represent if a special feature in their applications will be active for that license. In runtime, they call the function WLRegGetLicenseInfo and read that value of the "Custom Data" from the license. After parsing the information from the retrieved Custom Data they will enable and or disable specific functionality on their applications.
The Hardware ID field allows you to lock a license to a specific customer's machine. In order to fill the Hardware ID field, you first need to know the Hardware ID of your customer's machine. To do so, you can create an external application (or from your main application) and call the WinLicense SDK function WLHardwareGetId. After that, the customer will send you the displayed ID and you can fill the Hardware ID field for the license that you are going to generate.
Once that you generate a license locked to a specific Hardware ID, each time that your customer launches your protected application, the internal protection code will check if the customer's PC hardware ID matches with the one in the license. If the hardware ID does not match, WinLicense will signal the event MSG_ID_WRONG_HW_ID (from the Customized Dialogs panel). In case that the hardware ID matches, your application will start running normally in memory in registered mode.
License Restrictions
WinLicense accepts different type of restrictions for the generated licenses. You can create licenses with no expiration restrictions at all (so the license will work forever) or add one or more different expiration restrictions to a single license, so your license can expire for example by number of days or by number of executions (the one that happens first)
•Days Expirations: This is the number of days that your license can run since it was initially used. When your customer runs your application with a license with days expiration, WinLicense will keep track of the day that the license was first used. After that, the license will expire after the given number of days. When the license expires by days, WinLicense will signal the event MSG_ID_LICENSE_DAYS_EXPIRED (from the Customized Dialogs panel)
•Date Expiration: You can set a specific expiration date for your license. The license will expire when the expiration date arrives, even if the user has no launched the application before that date. When the license expires by date, WinLicense will signal the event MSG_ID_LICENSE_DATE_EXPIRED (from the Customized Dialogs panel)
•Executions: You can restrict a license to be only used a specific number of times on a machine. Each time that your application is launched, the internal execution counter will add one execution. When there are no more executions left, WinLicense will signal the event MSG_ID_LICENSE_EXECUTIONS_EXPIRED (from the Customized Dialogs panel)
•Runtime: You can restrict your license to be only used a specific amount of minutes in memory. Each time that the application is launched, the runtime expiration starts again from zero till it reaches the specific limit in the license. When your application has been running in memory during the specific runtime limit, WinLicense will signal the event MSG_ID_LICENSE_RUNTIME_EXPIRED (from the Customized Dialogs panel)
•Global Time: You can set the maximum time (minutes) that a license can be used on a machine. For example, if you set 180 minutes as global time expiration, your customer can launch your application multiple times but WinLicense keeps a counter of the number of minutes that your application has been in memory. Once that the customer has been running your application during more than 180 minutes (no matter if he just launched one time and consumed the 180 minutes or it took him 3 months to reach the 180 minutes) your license will be expired. When the global time is expired, WinLicense will signal the event MSG_ID_LICENSE_GLOBALTIME_EXPIRED (from the Customized Dialogs panel)
•Install Before Date: You can force a license to be installed on a machine before a specific date. If your customer installs the license after the specific date, WinLicense will signal the event MSG_ID_LICENSE_INSTALLATION_TIME_EXCEEDED (from the Customized Dialogs panel)
Miscellaneous
Apart from time restrictions, you can also set other special options in your WinLicense licenses.
•Store Create Date: This option inserts extra information in the generated license to store the date that the license was generated. You can retrieve the license creation date by calling the WinLicense SDK function WLRegLicenseCreationDate
•UNICODE License: If you are going to work with UNICODE licenses you should enable this option. When working with SmartKeys, you have to make sure that if you work with Unicode licenses, you call the WinLicense SDK SmartKey functions in their Unicode form (WLRegSmartKeyCheckW, WLRegSmartKeyInstallToFileW, WLRegSmartKeyInstallToRegistryW)
•Embed User Info in Key: This option is only for Dynamic SmartActivate keys. If you select that option, the SmartKey serial number will contain the user information as part of the serial number. When you call the SmartKey functions (WLRegSmartKeyCheck, WLRegSmartKeyInstallToFile, WLRegSmartKeyInstallToRegistry), you have to pass NULL for the user information parameters. Example: WLRegSmartKeyCheck(NULL, NULL, NULL, pSmartKey. Notice that when the user information is embedded inside the dynamic SmartKey, the generated serial number will be bigger as it contains the user information encoded as part of the serial number.
•Country Locking: This option is used to create a restricted license that can only be used in a specific country. Notice that the country is determined by the Windows Language settings and it's not a real proof that the user is really running your application from a specific country. If the current language does not match the specific country inside the license, WinLicense will signal the event MSG_ID_LICENSE_COUNTRY_ERROR (from the Customized Dialogs panel)
•Network Instances: This option is used to limit the number of instances inside a network. Please, refer to the Network Instances (Floating licenses) section for more information.