|
Items
How to start the trial period?
How to start the trial with the basic OLM?
How to start the trial with the advanced OLM?
How to extend the trial period?
How to register the application using a registration key?
How to register an application using the OLM?
How to rent your application by days, months and years?
How to erase the registration data?
HOW TO START THE TRIAL PERIOD?
Offline methods (two options)
(1) With the MakeTrial() method: This method generates and register a key of trial type according with the parameters passed, e.g. in the following call:
MakeTrial(0,2,1,date,30);
We request the generation of a trial period of 30 days for the index 0 to a maximum of 2 concurrent users allowed and only one instance, starting from the current system date. This method is called only when you first run the program, even when there are no registration data and GetKeyData () returns (Status = Unregistered).
The problem with the MakeTrial method is that the user can discover where the registration data is saved then removes it to get so an new free period.
2) Do not initiate the trial period and encourage to the user to ask from you a free trial key to initiate the trial period. This mean that your application will remain unregistered some time. I suggest you do not block the application while this unregistered period, instead enable your application with limited functionality, and encourage to the user to ask from you a free trial key to initiate a full featured trial period. See Protection schemes B,C,E and F. This method is more secure that the first one since when the user removes the registration data the application returns to its original (status = unregistered).
Online methods (two options)
For this approach we utilize the Online License Manager (OLM). For the option (1) with the basic OLM and for the option (2) with the advanced OLM. For both options the operation is totally transparent by the user and initiate a trial period automatically and the user will not need to deal with keys of any kind to get it.
Start the trial with the basic OLM:
For the basic mode is used the OnlineGetKeyB() method. This method is secure since when the user removes the local registration data, the trial status is restored to the previous state from the data saved in the web site. This mean that, if before to delete the local registration data the status was 5 days to expire, after restoring the data the status still will be the same 5 days to expire. Implemented in the example 1.
The call is made with the following line:
OnlineGetKeyB('000',0,0,30,1);
The parameters are:
'000' : Values.
0 : Kind (0=Trial).
0 : Module number.
30 : Trial Days.
1 : Authorized instances.
Start the trial with the advanced OLM:
See an implementation in Example 6 which uses the [Start Trial] configured to call the method OnlineStartTrial ().
OnlineStartTrial(0,2,1,30,'007');
The parameters are:
0 : Key index.
2 : Allowed users.
1 : Allowed instances.
30 : authorized days.
'026' : Values field.
See below two schemes for the OnlineStartTrial() method.

This scheme shows more details.
For the advanced mode is used the OnlineStartTrial() method, see at the image above the steps taken to start the trial period:
1. (red). A call to the OnlineStartTrial() method like in the next line:
OnlineStartTrial(0, 2, 1, 30, '026');
In the OLM are set defaults for the trial period that will be used if parameters are passed as zero or empty values:
$trialdays = 30;
$extendays = 15;
$trialusers = 1;
$trialinstances = 1;
$trialvalues = '000';
2. (green). The script advancedolm.php into the server generates a registration key for the given module, then generates a new record into the OLM to manage this module and return the calculated key to the computer where is saved into the local registration data. If the call is made when the trial period is already started, instead to create a new record there is read and returned the key from the existing record.
Using the OLM Control Panel we can see the record generated by the call to OnlineStartTrial(). Enter the following URL: 'http://av-soft.com/olm4/s4cp.php, then enter the password abc123, onto "search for" enter 12341 and for "Into the field" select "App ID". You will see a screen like this:

HOW TO EXTEND THE TRIAL PERIOD?
Offline way:
Send to the user a key of trial type to register your application. Generate the key using the KeyGen utility and set there the number of days that you want to extend the trial period.
Online Method:
See a sample in Demo1. Into the Registration Form into the TabSheet PrimaryRegistration and the [Extend Trial] button.

There is used the advanced OLM to extend the trial period with a call to the OnlineExtendTrial() method using the following line:
OnlineExtendTrial(0, 1, 1, 15, '390'); //for module 0
Before the user can extend the trial period you must modify the appropriate record into the OLM making Extend = 'Y'. This may be accomplished from the control panel or from the RegMonitor utility.
From the control panel:
Click the Edit icon from the proper record, then will be shown the edition panel. Then select the following radio button:

and click [Save Record]. You will come back to the previous screen, there click the [->Go] button to refresh the screen. Now you will see Ext = 'Y', granting a extension for the trial period which will be accomplished when the user calls the OnlineExtendTrial() method.
From the RegMonitor utility:
Enter the appropriate values for WebHost, Path, App ID, Encryption Key, InstallCode and Index and click on the [Go] button. So the record is read from the OLM and filled the fields with the corresponding values. As seen in Fig. Select "Allow to extend the trial period (Ext = Y)" and click on the [Save Data].

then you will get the following message:

Finally inform the user that the extension has been granted.
HOW TO REGISTER THE APPLICATION USING A REGISTRATION KEY?
The following steps must be accomplished:
1. The user send you the InstallCode. e.g. 058AF2-DF468A-166138-025661
2. Using this InstallCode you calculates the Registration Key through the KeyGen utility (see the left image).
There you enter the needed fields, the InstallCode received from the user and configure the key to be generated. In this sample the key is generated for the module 0 with one user and two instances authorized, the key will be of the Temporary type and authorized by 300 days starting at 11/09/2009 and Values = 657. The resulting key for the sample is: NWKA19E-UYCA2VP-5VC56A3-L5A0KP1
3. You send the key to the user. In this sample: NWKA19E-UYCA2VP-5VC56A3-L5A0KP1.
4. The user register the application using the key received from you using one of these two options: ONLINE and OFFLINE. In the example 8 are implemented both options.

a) ONLINE: The key and other registration data is saved into the local computer and also into the OLM database. The OnlineRegisterKey() is used.

Another scheme with more details:

Below is the code used on example 8 for this option:
procedure TRegForm.BtnRegClick(Sender: TObject);
var s: string;
begin
if not testfields(True) then exit; //test fields Username, Company, Email and Registration Key
writeData; //Write Username, Company and Email to the Local Application data before to register
//try to register the key and post data to the OLM
s:=Form1.AVLock.OnlineRegisterKey(trim(EdKey.Text));
if (s='50') then showmessage('Key registered successfully')
else showmessage('Registration Error: '+Form1.errormessage(s));
end;
b) OFFLINE: The key and other registration data is saved only into the local computer. Below is the code used on Demo 1 for this option:
procedure TRegForm.BtnReg2Click(Sender: TObject);
var err: integer;
s:string;
begin
if not testfields(True) then exit; //test fields Username, Company, Email and Registration Key
writeData; //Write Username, Company and Email to the Local Application data before to register
err:=Form1.AVLock.RegisterKey(EdKey.Text); //try to register the key
case err of
0: s:= 'Key registered successfully';
1: s:= 'Key length mismatch';
2: s:= 'Bad system date';
3: s:= 'Registration was removed';
4: s:= 'Invalid Registration Key';
else s:= 'Unknown error';
end;
showmessage(s); //show operation result
end;
HOW TO REGISTER THE APPLICATION USING THE OLM?
Related Items: How to use the control panel?
Using the advanced set of scripts php (OLM) it is possible to register the application at temporary or definitive way using the method OnlineRenew() passing with parameters the advancedolm.php script and the key index. The example 8 implements it with the [Activate] button.
This way is only possible if the related record already exists in the OLM, previously created when started the trial period. The user will be able to activate the new registration only if you previously change the related record and set Paid = 'Y', this could be accomplished with the control panel or with the RegMonitor utility.
Let us first see how to do it with control panel OLM. Enter the url "http://av-soft.com/olm4/s4cp.php", then enter the
password "abc123", finally in "Search for" enter "12341" and select the "App ID" field. You will see a record similar to that shown
down.

Clicking the Edit icon to the right of each record, you will enter to the following edit box where you could make necessary changes and save them with the [Save Record] button.

In order to prepare the OLM to generate a new registration key we should select the following option:

then enter the proper values for the fields Users, Instances and Values. Select the kind of key as Permanent or Temporary and for this latest choice also the number of days to authorize.

Finally click the [Save Reciord] button. You will see this message:

Now hit the [->Go] button and see the new values for the record which define the new key to be created.

This can also be done using the RegMonitor. From the tab [Olm Data] assign the values as shown in the figure below and click on the [Save Data].

In this example we saw how the record is enabled for a new key using the OLM control panel. Now using the RegMonitor utility set users to 3, instances to 2, and Values to '025', also select a temporary key and the number of days to 365.
After editing the OLM record, inform the user that the new key is ready to be activated with the [Activate] button.]

Below is the source code used for the [Activate] button in the example 8:
procedure TRegForm.BtnRenewalClick(Sender: TObject);
var s:string;
begin
if not testfields(False) then exit; //test fields Username, Company, Email and Registration Key
writeData; //Write Username, Company and Email to the Local Application data before to register
s:=Form1.AVLock.OnlineRenew(0);//try to renew the key
if (s='00') then showmessage('Renewal Applied') else showmessage(Form1.errormessage(s));
end;
From the OLM, the advancedolm.php script calculates the key according the new values and send it to the application, which finally makes the registration, obtaining the same result as when the registration is done manually by entering the key as we saw earlier.
HOW TO RENT THE APPLICATION BY MONTH, YEAR, ETC?
Related Items:
How to register the application using a registration key?
How to register an application using the OLM?
Using one of the previous options register a temporary key for the wanted period.
HOW TO DELETE THE REGISTRATION DATA?
Related Items:
Example 1: Deleting the registration data
Methods : General Methods and Methods for Internet
To erase local registration data we use the methods EraseReg() and EraseKey() and to delete both, local and the OLM data we use OnlineRemoveKey() with the basic OLM and OnlineRemoveReg() with the advanced OLM.
I tried to make this help file clear, readable and complete, this is my goal, but it is possible that I leave behind some important things that you were expecting. So, if you miss something or have found bugs or have some idea to improve this help, please let me know.
|
Alcides Valega
Author of AVLock SIMPLE
|
|