AVLock Gold (c) Alcides Valega, 2002
Table of contents
What is AVLock Gold?
AVLock Gold is a Delphi component wich allow you to convert your application into a time limited trial in a very ease way. In adittion, with AVLock Gold you can:
To make a 30 days trial application you simply must locate an AVLock Gold control in your main form and to write the following line of code at the OnCreate event:
if not AvLockGold1.execute then Application.Terminate;
That's enough to convert the application in a 30 days trial version. However, you can to use AVLock Gold in several other more powerful ways, making your own interface or changing the default values of properties to adjust it to your needs.
AllowBackDate: Type: boolean. When this value is True then the user is able to backward the system date to reuse an expired period.
AppCode : Type: dword. Numeric value to identify the application. For default his value is 123456789 but is convenient to assign different codes for each application.
AppName : Type: string. Name assigned to your application. this appear in the title bar of the registration windows. For default this is leave blank.
Authorized : Type: boolean. When it is True, this mean that application is temporarily registered.BeginDate : Type: boolean. Date from where start the authorized period.
ColorForm : Type: TColor. The background color of the Registration form. Default clBtnFace.
Days : Type: word. The number of days for the initial trial period. default 30.
DaysLeftToWarning : Type: byte. The number of days before expire for to show the TextWarning message. default 15.
EndDate : Type: date. Date from where end the authorized period.
Expired : Type: boolean. When it is True, this mean that trial/authorized period was expired.
FirstTime : Type: boolean. When it is True, this mean that application run first time in the computer.
InstalCode :Type: string; Length: 6. Hexadecimal Strig Value, not visible at design time. When your application run in the user PCs, AVLock Gold calculate a hexadecimal number called InstalCode, distinct one for each PC and calculated in basis of the several sources (see InstalCodeSources property). This code must be sent to you from the users so you can generate with KeyGen.exe the apropiate Registration Key for each user. For more information see below the description for the keyGen.Exe utility.
InstalCodeSources : Type: set. This property allow to determine from where come the value for the InstalCode property. These sources can be chosen (one or more) between these ones: Bios_SN (The serial Number from the Bios), CPU_ID (a code from the CPU) and HD_SN (The Hard Disk Serial Number), RandomNumber (a random number generated at first time your app run and stored in the Windows registry), UserName (a code calculated in basis to the full user name and stored in the Windows registry). If you chose UserName then your user must send to you his full user name instead of the install code.
MaxDays : Type: word. The max number of days allowed for the Days property (1..65535). Default 360.
MaxModules : Type: byte. The max number of modules allowed (1..254). Default 10.
Prompts properties : Type: string. These properties allow you customize and adapt the component to any language, these are: FPromptHowToRegister, PromptSendTo1, PromptSendTo2, PromptWaitUntil, PromptToRegisterNow, FPromptUserName, FPromptRegKey, PromptBeforeExpire, PromptAfterExpire, PromptBtnReg, PromptBtnCancel, PromptBtnContinue, PromptSuccessfull, PromptInvalidCode and PromptYouMust.
Registered : Type: boolean. When it is True, this mean that application is Permanently registered.
ShowProgress : Type: Boolean. If True then the Registration form show begin date, end date and a progress bar with the position of the current date into the authorized period.
Text's properties : Type: string. These properties allow you to change the default warning messages: TextCongratulation for initial trial period, TextExpired to show when trial period expired and TextWarning to warning to the user when the days to expire for any module reaches the value for the DaysLeftToWarning property.
Users : Type: byte. Max users allowed (1..254). Default 1.
Warning : Type: boolean. When it is true this mean that TextWarning text must be exposed.
Check: function Check(RCode:string):boolean; This method return true if the given Registration key RCode is ok.
Clear: This method clear all properties in the component.
Decode: function decode(RCode:string;var dat,day,users,modul:word):integer;
dat : date to start the authorized period.
day : days of the authorized period.
users : max allowed users.
modul : number of module (0=Main Application) (1..254=common modules) (255=Trial period).
decode return a integer value that mean:
0: Not error
1: wrong length
2: Instal code and registration code mismatch
3: validation error
EraseReg: function EraseReg(modul:byte):boolean; This method erase the registration data in the Windows registry for the given modul module, if modul=0 then all registration data is erased, therefore the next time that the application execute this become trial.
Execute : function Execute:boolean
This method see in the registry data if that is the first time that application run in the computer, if so, initialize the registry data establishing the trial period according to the Days property. Then, if the application is inot registered yet, call the DoExecute method to show the registration form. Return true if the user was pressed the Continue button and the application is registered or it is into the trial period, for more details about how to use it see the Demo1 sample.
Make: function Make(first:boolean; module:integer): string;
This method return a registration key in basis of the properties values. The parameters mean:
first : if True then Make return a registration key to start the trial period (force module value to 255), this is used in the Execute Method to start the trial period when the application run first time. If False then Make return a normal registration key (internal module value= 0..254).
modul : This value indicate the corresponding module to register to. For the main application modul=0, for common modules modul is in the 1..254 range and for trial period modul = 255.
MakeTrial: procedure MakeTrial;
This method return a registration key which start the trial period. MakeTrial invoque the Make method at the next way: Make(true,255);
DoExecute: function DoExecute: boolean;
This method show the built-in registration form. You can call it to invoque the registration form in any location of your application. The Execute method call it to show the registration form and return true if the user was pressed the Continue button and the application is registered or it is into the trial period, for more details about how to use it see the Demo1 sample.
Read: procedure Read;
This method read the registration data from the Windows registry and put these values into the properties of the component.
ReadModule: procedure ReadModule(n:byte;var dat,day,users:word; var expir,regist,authoriz:boolean);
This method read the registration data for the given n module from the Windows registry and put these values into the following parameters:
dat : date to start the authorized period.
day : days of the authorized period.
users : max allowed users.
expir : the expiry status for the given module: True=module expired.
regist : if true then the module is permanently registered (never expire).
authoriz : if true then the module is authorized in temporary way starting at dat date and for the day period.
Write : procedure Write(RCode:string); This method write the RCode registration key into the Windows registry.
WriteLastDate : procedure WriteLastDate; This method write the last system date into the Windows registry. This procedure is called for the Execute method, this is for take track of the last date that the application has been executed for the user, so if the user backward the system date and the AllowBackDate property is false then the application become expired.
This utility allow to generate the registration codes that your users need to register the main application and modules in his machine. Into these codes come all data needed to establish the appropriate values for the AVLock Gold component in the target application, so you can enable/disable the main application and extra modules at distance sending these registration keys to your users.
Type of registration keys: You can to generate two kind of registration codes:
a) For the main application: The code generated is to register the main application (module=0)
b) For extra modules: The code generated is for the extra modules (1..254).
1) Permanent : This mean that the generated key is for permanently register the application without time limit.
2) Temporary: This mean that the generated key is for a limited period of time bounded between two dates who are stored for the main app (module=0) in the BeginDate and EndDate properties. This allow you to rent your application, since through of registration codes you can habilitate new authorized periods as many times as you likes. For the extra modules (1..254) the registration key is stored in the registry and can be retrieved whit the ReadModule method.
3) Unregister : This mean that the generated key is for unregister either all registration data stored in the Windows registry or only for the given module depending of the option checked, a)Main app, or b) Extra modules.
To generate the registration key you must enter the following values:
Use the full user name instead of the Install Code checkbox: When checked hide the Install Code field and show the full user name field.
InstallCode: (not for UserName InstalCodeSource) The install code coming from the user application (see InstalCode property).
UserName: (only if you chose the UserName InstalCodeSource) Here you must to enter the full name from your user.
AppCode: Is the code that you was chosen for your application, can be any integer value.
Module: If you chose the b) For extra modules option, then you must to enter the module (1..254) which you want to apply to the generated registration key.
Generate button: press this button to generate the registration code with all data entered above.
registration Code: this is the registration code that you must send to your user.
This utility is very useful to test how to work AVLock Gold. You can customize and ship it together your application as an additional utility. There is two main sections:
1) Registration staus for this PC: Here you can see the registration status for the current PC, for the main application and for all registered modules.
2) Registration Key: Here is where you enter the registration key and see the action that will be done and finally you can perform this action in the current PC. If you check the Use the full user name instead of the Install Code checkbox then show the full user name field, in this case you must to fill this field too.
If you want to test the component in your PC, open these two utilities, KeyGen.exe and Register.exe, select and copy the InstallCode in red color at Register utility and paste it into the InstalCode edit box at KeyGen utility, enter the AppCode that you was chosen for your application, check the appropriate radiobuttons, fill the needed fields and push the [Generate] button. Now you can to copy the generated Key and paste it into the edit box of the Register utility, push the [View Action] button, compare the action to do information with the options chosen in the GeyGen utility. Push the [Perform action] and see the updated information in the Registration status section. If you want to unregister all registration data in your PC then generate a Registration Key with the Main app and Unregister radibuttons checked, copy it to the Register utility and Perform the action.
This utility erase in the Windows registry the saved registration information for the main application or for the module that you was chosen. If you chose the main module then the all other modules will be unregistered too, in this last case, the next time that your application execute this become trial.
Demo1 : This show how to make a trial application in the standard way, with only one line of code.Demo2 : This show how to make a trial application in an advanced way, with a customizad registration form.
How to install AVLock Gold
1. Unzip the component zip file into a folder.
2. From your Delphi IDE open the AVLockGolD(x).dpk package.
3. If you get the message "This package appears to be in an older format. Wold you like to convert it to the new format?" then reply No.
4. Press the install button. Wait for the Delphi message "The following new commponent(s) have been registered:. . ."
4. Review your Library Path into the Tools|Environment Options|Library tab. Here you should have one entry (only one) pointing to te folder where you unziped the component. If you have not this entry then create it manually.
How to Purchase AVLock Gold.
Click here to purchase the commercial version of AVLock Gold at $39.95
Click here to purchase the full pack with source code at $79.90
How to Upgrade from the commercial version to the full pack with sources.
You can uprade from the commercial version to the full pack with sources purchasing again the commercial version at $39.95. If you do it then email me to firstname.lastname@example.org and I will send to you via email the full pack with sources.
AVLock Gold Software License Agreement.BEFORE PROCEEDING WITH THE INSTALLATION AND/OR USE OF THIS SOFTWARE, CAREFULLY READ THE FOLLOWING TERMS AND CONDITIONS OF THIS LICENSE AGREEMENT AND LIMITED WARRANTY (The "Agreement").
BY INSTALLING OR USING THIS SOFTWARE YOU INDICATE YOUR ACCEPTANCE OF THIS AGREEMENT. IF YOU DO NOT ACCEPT OR AGREE WITH THESE TERMS, YOU MAY NOT INSTALL OR USE THIS SOFTWARE !
AVLock Gold Software, including documentation, source code, object code and/or additional materials (the "Software") is owned by Alcides Valega (the "Author"). This Agreement does not provide you with title or ownership of Product, but only a right of limited use as outlined in this license agreement. Software author hereby grant you a non-exclusive, royalty free license to use the Software.
You are granted a non-exclusive, royalty-free right to reproduce and redistribute executable files created using the Software (the "Executable Code") in conjunction with software products that you develop and/or market (the "Applications").
THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PRODUCT IS WITH YOU. SHOULD THE PRODUCT PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING OR ERROR CORRECTION.
THE AUTHOR OF AVLock Gold DO NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE SOFTWARE WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR FREE.
If you have any questions regarding this agreement, or you have any comments, suggestions or bug-reports, please forward it to: email@example.com
Author : Alcides Valega
Address : Santa Cruz 1468, 3400-Corrientes, Argentina
E-mail : firstname.lastname@example.org
URL : http://avsoft.sitio.net