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 number in the license file be greater than or equal to the version number specified in the application, the license file will determine how long users can continue to use new updates of the software. If the software version date is later than the date specified in the license file, that version of the software will not work without an updated license.
To use dates for version numbers:
In the license file, set the major version number to yyyy and the minor version number to mmdd, as shown in the following example, which specifies the license file will work until 2014, October 3:
<?xml version="1.0" encoding="utf-8"?> <LICENSEFILE> <FEATURE NAME="F1"> <SETTING MAJOR_VERSION="2014" /> <SETTING MINOR_VERSION="1003" /> </FEATURE> </LICENSEFILE>
Set the version number in the application to the current compile date (which must be earlier than or equal to the license file date), as shown in the following example, which specifies the compile date 2014, January 1:
int nYear = 2014; int nMonth = 01; int nDay = 01; int nMajor = nYear; int nMinor = nMonth * 10 + nDay; LMX_Checkout(LmxHandle, "F1", nMajor, nMinor, 1);
When you create a future release that specifies a compile date later than the license file date, as shown in the following example, LMX_Checkout will return an error, and the user will require a new license file to run the new version of the software.
int nYear = 2014; int nMonth = 12; int nDay = 30; int nMajor = nYear; int nMinor = nMonth * 10 + nDay; LMX_Checkout(LmxHandle, "F1", nMajor, nMinor, 1);