You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

To create a license that will work only up to a specific date, you can use dates for major and minor version numbers as an alternative to specifying software release numbers.

Since LM-X requires by default that the version in the license file be greater than or equal to the number specified in the application, the license file will determine how long users can continue to use new updates of the software. If a software version has a date newer than the license, that version of the software will not work without an updated license.

To use dates for the version numbers, set the major version number to yyyy and the minor number to mmdd. For example, you could encode a license file to work until 2014.1001 (October 1, 2014), and set the version number in the application to the current compile date. In the future, when you create a new release with a date later (greater) than the license file date, say 2014.1201, that new version will require a new license file.

After setting version numbers, the XML template for a node-locked license looks like the following:

<?xml version="1.0" encoding="utf-8"?>
<LICENSEFILE>
<FEATURE NAME="F1">
<SETTING MAJOR_VERSION="2014" />
<SETTING MINOR_VERSION="1001" />
</FEATURE>
</LICENSEFILE>

To ensure successful license checkout, base your code on the following example, where "nYear", "nMonth" and "nDay" indicate a year, month, and day of the release respectively.

int nYear = 2014;
int nMonth = 9;
int nDay = 22;

int nMajor = nYear;
int nMinor = nMonth * 10 + nDay;

LMX_Checkout(LmxHandle, "F1", nMajor, nMinor, 1);

LMX_Checkout will return an error if code includes the date later (greater) than the license file date, as shown below:

int nYear = 2014;
int nMonth = 12;
int nDay = 3;

int nMajor = nYear;
int nMinor = nMonth * 10 + nDay;

LMX_Checkout(LmxHandle, "F1", nMajor, nMinor, 1); 
  • No labels