Timed Trials

Timed trials let customers evaluate your app for a limited period before buying. A trial activation is keyless, so the user starts one without entering a license key. Cryptlex trials are verified and node-locked, so a trial does not reset if the user reinstalls your app or reformats the machine. Each trial activation appears in the admin portal under Trials -> Trial Activations.

How a trial works

  1. Start the trial on first run with ActivateTrial(). Call it once, ideally on a button click, not on every start, since each call re-validates against the Cryptlex servers.
  2. Verify on every start with IsTrialGenuine(), after your IsLicenseGenuine() check, and read the time left with GetTrialExpiryDate(). This works offline.
  3. If verification returns any other status, the trial has either not been activated on this machine yet or could not be validated. Handle the returned status before deciding to call ActivateTrial().
  4. When the trial expires, the functions return LA_TRIAL_EXPIRED; prompt the user to buy a license.

Extending a trial

You can extend a trial to give a customer more time to evaluate your product:

  1. Ask the customer for their trial ID. Your app gets it with GetTrialId().
  2. In the admin portal, open Trials -> Trial Activations, search for the trial ID, and from the actions menu choose Update Expiration Date, pick the new date, and click Update.
  3. In your app, call SyncTrialActivation() to pull the new expiry date to the client without reactivation. It also refreshes trial activation metadata if you have set any.

Sample code

For the full flow and per-language samples, see Using LexActivator.

// On every start, after the IsLicenseGenuine() check
status = IsTrialGenuine();
if (LA_OK == status) {
// trial is active
unsigned int trialExpiryDate = 0;
GetTrialExpiryDate(&trialExpiryDate);
} else if (LA_TRIAL_EXPIRED == status) {
// trial has expired, prompt the user to buy a license
} else {
// trial has not started, start it (for example, on a button click)
status = ActivateTrial();
}
Software Maintenance and SupportContainers and Virtual Machines
Last updated: