AV-SOFT.COM
AVLock SIMPLE
Introduction
What is AVLock Gold?
How to buy AVLock Gold?
How to Upgrade from previous versions?
What's new in version 5
Another AVlock components
License Agreement
Using AVLock Gold
How to install AVLock Gold?
How works AVLockGold?
Brief practice with demo's
Step by step samples
Basic sample
Working with modules
Creating your own registration form
Running on a network
"MoveReg" feature
Some configuration issues
Hacking cautions
How to translate AVLock Gold to any language?
Properties
Methods
Events
Useful concepts
Registration keys
KeyFiles
RegFiles and ControlFiles
RegistryKeys
MasterComputers and RegularComputers
Utilities
AVLockManager
RegMonitor
Configure
KeyGen
Php key generators
FAQs

Working with modules

Top  Previous  Next

avlockg53

The previous sample shows how to manage a simple application only with the main module without any extra module. AVLockGold allow you to manage until 254 extra modules. In this sample you will learn how to manage extra modules in your application. This description is only for the Delphi VCL platform, however there are no much differences with the .NET approach. If you are a .NET programmer then I encourage you to read this topic,  you will find it very useful.

..

 

1. Open the Delphi IDE.

 

2. Open the application Demo2 from c:\AV_Soft\avlockg5\samples\demo1.

 

3. Open the project file with Project > View source. Take a look to the source. All lines referring to the AVLockGold configuration has been moved here, see below this section from the Demo2.dpr file.

 

//******* AVLockGold section ***********

with Form1.avlockG51 do begin

   EncryptionKey := 'myencryptionkey123';

   execute;

   form1.settext;

   form1.setmodules;

end;

//**************************************

 

NOTE: This code has been moved here to avoid a possible hacking attack. Please see the Hacking cautions topic.

 

4. Take a look to the unit2.pas file, see how to get the modules status and his names into the setmodules procedure.

 

5. Compile the project.

 

6. Open the AVLockManager utility.

 

7. Click the [Add] button in order to add Demo2 to your application list. Fill the fields as follow:

 

Application Name  :  'Demo2'

Application Path     :  Fill with your application path (e.g. c:\AV-Soft\avlockg5\samples\demo2\\)

Executable File       :  'demo2.exe'

Encryption Key      :  'myencryptionkey123'

 

8. Click the [Ok] button in order to save the new application.

 

9. See in the "Settings" tabsheet and make sure you have the following settings (the original setting):

 

Lock strategy :  InstallCode based with "Bios Serial Number", "CPU_ID" and "HD_Serial Number" checked.

Trial Mode     :  Relative 30 days. "Include modules in the trial period" checked.

Options for the registration form                       : All checkboxes checked.

Action to take when a Module-ID changes        : Disable the module.

The user name is requested at first time        : checked.

The user name is requested in the registration process        : checked.

The program expires when the user turn back the system date : checked.

 

10. Open the "Modules" tabsheet. Take a look to the Modules grid, there is anly one row for the main module.

 

NOTE: The module 0 is for the main application and modules from 1 to 254 are extra modules.

 

11. Click the [Append] button in order to add a new module to the grid. A row is appended for the module 1

 

12. Enter the values; 1 for the "Module-ID" column and 'Views' for the "Module-Name" column.

 

13. Append another three modules; 'Reports', 'Special' and 'Utilities' as you may see below in a final view:

 

modules02

 

14. Click over the [Run] button. The Demo2 will run the first time and the trial registration will be done, you will be prompted to enter your user name and company, then the registration form will come up.

 

regform01

 

15. Take a look to the regisration form. You may see the 'Modules' section with all modules in 30 days trial mode [30 days left] alike to the main application, 'Days left to expire: 30'. This occur since you have checked the "Include modules in the trial period" checkbox. Otherwise you will get all modules in the Not registered status.

 

These are the parts of this form:

 

a) The message area on the top of the form, here you see the congratulation message. 

 

b) The logo image on the top right corner. This image can be changed for your

   own logo, see the Logo property.

 

c) The InstallCode. The users should send this hexa code to you, in order

   that you can generate the RegKey to register the application. 

 

d) The "Modules" section:  Here is displayed the list of available modules and his status.

 

e) The "How to register" section:  Here the user can select the method to

   purchase your program between these following ones:

   Online registration: From your seller site through the link that you put into

    the OnlineLink property.

   Via email: Sending a email message to your mailbox at the address that

   you put into the EmailAddress property.

   Another way: Allow you explain any other different way to purchase

   your program.

 

f) The "Register now" section: Here the user will register your program. Once

   he did received from you the RegKeys that you was generated with the

AVLockManager utility, the user introduce these codes into the keys area

   then click on the [Register] button.

   When you want to register more than one RegKey, e.g. for the main app

   and for some others modules then can be more affordable that you

   generate a KeyFile and send it to the user. If so, the user should click the

   [load from file] button and select this KeyFile to load all RegKeys together.

 

g) The expiration message: with the text 'Days left to expire: 30'

 

h) The [cancel] button: if the user click this button then the program terminates.

 

i) The [Continue >>] button: if the user click this button then the program

   starts with your main form. This button is disabled when the trial period expired.

 

16. Select the "InstallCode" value and copy it into the clipboard (Ctrl-C) or manually copy it in anyplace you want. This will be used in the step 20.

 

17. Press the 'Continue >>' button, then take a look to the main form. There you may see all modules as menu options. Close the application.

 

appform02

 

NOTE: Above you can see repeated the username and company, one for the Main registration and other for the Local registration. Why two kind of usernames? 

On a single PC both values are the same. On a network these are different for Regular PCs. Please review the source code for the demo2 program.

 

What happen after you ran the program? What changed on the executable directory and the local registry?

If you have selected "Data stored in" = "Local_Registry" then the registration data will be stored in the local Windows registry. If you have selected "Data stored in" = "Registration_File" then the registration data will be stored in the application directory into an *.avr file.

 

18. Open the "Keys & Users" tabsheet.

 

19. Click the [Add] button into the users groupbox in order to add a new user to your users list. The "add user" form will be displayed.

 

20. Fill the fields "User name", "Company" and "Email address" with your own data or any other.  Fill the "InstallCode" field with the value stored in the clipboard (Ctrl-V) or enter it manually. Fill the "Max users" field with the value that you want to use. If you enter 0 then the max users will be unlimited.

 

21. Click the [Ok] button in order to save the new user.

 

22. Make Temporary the "Key Types" for the modules 3 "Special" and 4 "Utilities" and set 90 days for each, then check all "Gen" checkboxes. Your grid will take up the foollowing look. 

 

modul&keysgrid

 

23. Click the "Save keys to file" button, then save the key file as 'demo2.avk' into the app dir (e.g. c:\avlockg5\demo2\). This file will hold the five generated keys.

 

24. Click the [Run] button. Take a look to the registration form. All, main app and modules in 30 days trial period.

 

25. Click the [Load from file] button, then select the 'demo2.avk' file saved in the point 23. The five keys will be added to the Keys box.

 

regform02

 

26. Click the 'Register' button. You will be prompted to enter your user name and company.

 

nameform

 

26. Then a messagebox will be displayed with the text "5 Keys Registered" and then the main form displayed. The Demo2 program had passed from the Trial status to the Registered status.

 

5keys

 

27. Into the menu of the main form select File > Registration in order to invoke again the registration form.

 

28. Now, in the registration form you may see the changes caused by the registration process. Now there are no information about the main application (days left to expire and progress bar) since the application is permanently registered. In the top panel you will see the "Demo2. Registered to <user name>" message. In the 'Modules' section, there are the list of all modules with his status. 1 and 2 with permanent registration [Registered], 3 and 4 with temporary registration [90 days left].

 

Modules01

 

 

If you have any questions not answered by this help file, please don't hesitate to contact me at http://valega.com/contacto.php.