TbcTrialVersion is a VCL Component for Delphi and C++ Builder. It provides �trial period�
capability for your software. TbcTrialVersion stores information about the trial usage of the software and decides if the software has expired or not when asked.
Information regarding the trial period is kept in Windows registry in either plain or encrypted form.
Users of the component can supply their own encryption algorithms if they want to do so.
Encrypted information will be harder for hackers to locate in the registry.
Create Trial / Evaluation Version Software Using Delphi Component
You drag drop the component and set it�s properties. In your application, you check IsExpired property to see the whether the evaluation has expired or not. If evaluation record is not found in the
registry, you call RecordExpirationInfo procedure. It can also be called in an installer. The trial version types can be one of the following:
a) While IDE is running (Delphi or C++ Builder) b) Expire in n number of days
after first try (or installation if the installer creates the required registry information) c) Expire on date. d) Expire after n number of tries
.
To use this component, the programmer sets couple properties such as expiration date (or # of tries) and picks the Windows registry section to record the information in; chooses a hard to guess registry
subkey name(can be encrypted); and writes an if block in his application to ask the component if the application has expired or not.
Once an application expires, the component can set a flag in the registry so that after re-installation the program will still know that it was tried and trial period has expired.
Screen Shots:
Figure shows the properties of TbcTrialVersion component.
Basic Code Sample a Typical User needs to write:
procedure TForm1.FormCreate(Sender: TObject);
begin
{
bcTrialVersion1.InfoFound tells if the trial period
tracking info is found.
Typically, this info is created by the
bctrialVersion1.RecordExpirationInfo; call when the software
is first run.
}
if not bcTrialVersion1.InfoFound then begin
bctrialVersion1.RecordExpirationInfo;
end;
{
IF (EXPIRES_IN_DAYS) selected:
This bcTrialVersion1.IsExpired call will compare today's date with
the recorded trial period start date and the trial period length and
decide if it expired.
Once it expires, it also sets a flag recording the fact that it once
expired, so that setting the computer time to an earlier date will
not work!
IF(EXPIRES_ON_DATE) selected:
This bcTrialVersion1.IsExpired call will today's date with the recorded
trial period ending date.
IF(IDE_RUNNING) selected:
This bcTrialVersion1.IsExpired call will return false if Delphi or
C++ Builder is not running.
IF(NUMBER_OF_TRIES) selected:
This bcTrialVersion1.IsExpired call will check the registry
to find out how many times the software was run before and will
compare it to the maximum limit that was set.
Will return false if limit reached.
}
if bcTrialVersion1.IsExpired then begin
Application.MessageBox('Trial Version of this software has expired.', 'Evaluation Period Ended.', MB_OK);
Application.Terminate;
exit;
end;
{
If trial period has not ended yet, you typically display some info on how many
more days the trial version of your software will run.
}
Label1.Caption := 'Evaluation period days left:';
Label2.Caption := IntToStr(bcTrialVersion1.DaysLeft);
end;
|
|
Source code of the component can be used in Delphi 4,5,6,7, 2006, 2007 and C++ Builder 4,5,6, 2006. It also contains a demo application and the help file for the component.
Help file is available for download for quick review[64KB]
Download TbcTrialVersion Component
TbcTrialVersion is distributed under Apache 2 license . You may download here. Zip file includes Delphi Pascal source code. It should be possible to use it in Lazarus / Free Pascal as well.
For technical questions please contact support@gobestcode.com
|