Project name: EZTrial1
If you are looking to implement timed demo versions that can be unlocked and optionally copy protected, the EZTrial1 project is the best place to start. We have done most of the logic programming for you, using the algorithm defined under Concepts & Definitions EZ Trial topic. The sample application EZTrial1 is included to demonstrate:
Opening a License File
Determining the mode of the trialware application (demo, expired, retail, etc.)
Displaying a demo form with the number of days and/or runs left
Disabling menu options when application is a demo (to encourage purchase)
Disabling the application from running when demo has expired
Displaying a Trigger Code screen using EZ Trigger to activate the software when they purchase
Feel free to browse, copy the source code and paste it into your own application. To learn how to implement EZ Trial and EZ Trigger in your own application from scratch, refer to the topic Implementing EZ Trial and EZ Trigger.
Modules/forms/files in project
frmMain – form that simulates your application and hosts the PLUS control. This form has several menu options that simply display message boxes. When the form is loaded, the necessary properties are set so that it can open the License File. The StatusChanged event fires after opening. This event determines the mode of the application and takes necessary actions such as displaying the frmDemo form or making the main form visible (it starts out as invisible).
frmDemo – form displayed when the application is in demo mode, expired, or the clock has been turned back to gain additional usage. It is on this form where the user can choose to view your web site or unlock the software using EZ Trigger. When a valid Trigger Code is entered, the StatusChanged routine is called to re-evaluate the mode of the application.
sample.ini – license file that contains the parameters for EZ Trial, such as the number of days and/or times to run when in demo mode.
This sample application requires that the License File exist in the application directory. One is provided in this directory but will only allow the sample application to run a limited number of times. To recreate or reset the demo period, use LFEdit to create a new License File.
Select Product Definition in LFEdit
Run LFEdit from Start / Programs / SoftwareKey Licensing System / PLUS. If using an evaluation copy, change the product name in the toolbar combo box to EZTrial1. If this is not in your list, go to Tools / Options and select Use Sample Definitions. When done experimenting with the sample applications, be sure to change this setting back to Use My Product Definitions. Click on the Product Definition / Properties menu option. Click on the EZ Trial Parameters Tab and change the properties. Press F1 for a description of all of the fields and their purpose.
Create a License File in LFEdit
In LFEdit, click the New button on the toolbar. Click on the Expiration Fields Tab. Make sure the Expiration Type is D for Demo and that a hard expiration date is filled in. Even if you are letting the application run for an unlimited number of days, a hard expiration date must be filled in. To essentially disable the hard expiration date, fill in 12/31/2050. Click File / Save As. Change the file directory to the directory where your sample application is located and click Ok to save the License File.
Run Your Application
The application should run the number of days and times specified when you created the License File.
Activate the Application Using EZ Trigger™
On the demo form, click on the Unlock by Phone button to display the Trigger Code dialog. Write down the two numbers on the form. These two numbers are what your customer will give you by phone, fax, or e-mail. Run LFEdit. With the correct Product Definition selected in the toolbar, click on the Trigger Codes button (lock) on the toolbar. Select Code 18 if not using Hardware Binding (copy protection) or 31 if Hardware Binding was selected on the EZ Trial Fields Tab. Click Select. Enter the two numbers previously written down and click Generate. Write this number down. This is the unlock code that will be given to the customer. Minimize LFEdit and enter this code into the application. You should see the "Activation Complete" message appear.
More Information
To extend the number of days, use Trigger Code 19 or 20. To extend the number of executions, use Trigger Code 25.
The Typical Implementation EZ Trial topic discusses an alternative way to implement EZ Trial in your application from scratch. There may be cases where EZ Trial does not offer the exact implementation that you are looking for. In this case, you can customize the software licensing features by referring to the other implementation topics in the manual.
For all sample applications, the License File password used is password, the Trigger Code Event ID seed (RegKey1) is 400 and the Trigger Code Event Data seed (RegKey2) is 123.