^ What's the point?
^ Requirements
^ Installation
^ Configuring the Registration Tool for MySQL server
^ Upgrading from version 1.x
^ Basic steps for using the Registration Tool
^ Problems with floating point numbers
^ Properties
^ Methodes
^ Events
^ Localizing the component
^ TRegistration in shareware and commercial software?

Download :: Topics on this subject on the Forum :: Top
TRegistration

TRegistration is Delphi component for use in Win32 (2K/XP/Vista/W7) software.
If you are a shareware developer you'll find TRegistration very usefull.
You put it on the form and have a component that handles the registered/unregistered state of your application and includes a form for the user.
You can select where do you want to keep your settings an .ini file or the registry, has a couple of events also and properties too.

The other part of the package is the Registration Tool, with which you can handle and manage the MySQL registration database.
The system is designed for manual use:
  • Registering a user takes a couple of seconds (there is an "Add share-it e-mail in clipboard" option also which makes it's usage really simple)
  • Multiple projects can be managed
  • Automatic creation of registration number e-mails
  • Full unicode support
The form that appears in your app.:


The Registration Tool program's snapshot:



Requirements
  • Compiling the Registration Tool requires at least Delphi 2009.

Installation
  • Unpack the package (TRegistration*.zip).
  • Helper3delite.pas is needed in the search path.
  • Delphi 2009:
    • Menu: File/New/Package Delphi
    • In project manager (in the upper-right corner by default), right-click on "Package1.dproj" and select "Add..."
    • Unit file name: click "Browse" and select "RegistrationDefs.pas" and click "Ok"
    • In project manager (in the upper-right corner by default), right-click on "Package1.dproj" and select "Install..."
    • Save the package.
If everything went smooth, you can access the TRegistration component on 3delite's tab.


Configuring the Registration Tool for MySQL server

Running the Registration Tool requires a valid database connection string (menu: "Options/Settings...").
The only thing you have to take care of by default is the "Data Source" property.
On Windows XP the "(local)" value seems working: "Data Source=(local)" (this is the default).
On Windows 7 use "ComputerName\SQLEXPRESS" value (change ComputerName to your computer name).
If you want to use a different MySQL server version, you'll probably have to adjust the connection string.


Upgrading from version 1.x

From version 2.0 Registration Tool uses MySQL database to store the registration information and requires Microsoft SQL Server 2008 R2 Express installed.
  • 1. Download and install Microsoft SQL Server 2008 R2 Express
  • 2. Run the Registration Tool
  • 3. Select menu: "Options/Create New Database..."
  • 4. Specify the options and click "Create New Database"
  • 5. Select menu: "Options/Import V1.x Database..."
  • 6. Specify the old "Settings.ini" file in the old project folder and click "Import"
If everything went smooth the old (file based) database will be converted to MySQL database.


Basic steps for using the Registration Tool

When running the Registration Tool for the first time, it will complain about not being able to connect to the MySQL server.
  • 1. Set up the database connection string as described above.
  • 2. Select menu: "Options/Create New Database..." specify the options and select a file name (note: on Windows Vista and up use a file name for which you have rights to create). Click "Create New Database". Close the window.
  • 3. On the main window click on "Project Manager...", the project manager will come up.
  • 4. Click on "Add New Project...", specify the options, specify the registration seed that you use with TRegistration in your program, and create a new project.
  • 5. Select the newly created project and click "Add New SubVersion...". Specify the version code seed that you use with TRegistration in your program.
Adding a new registration user:
  • 6. Go back to the main window, select the newly created project and select a sub version from the combo box.
  • 7. Fill in the ("Registration Info") name and e-mail edit boxes and click on "Add". A new registration will be added to the selected project.
  • 8. Click on lower "Send E-mail" button to send the registration number to the user.
If you are using Share-It as your registration processing provider:
  • 6. Select all the e-mail contents that was sent by Share-It and copy it to the clipboard.
  • 7. In the Registration Tool click on "Add Share-It e-mail", the clipboard content will be processed and a new registration will be added to the selected project.
Sending out a version code:
  • 1. When a user requests a new version code, identify the user by it's registration number (first 6 digits of the registration number is the users registration ID).
  • 2. Make sure the correct sub version is selected. Look up the user and select the entry in the list.
  • 3. Click on the upper "Send E-mail" button to send the new version code number to the user.

Problems with floating point numbers

On other than english Windows operating system versions if you get an "Invalid floating point value" error adjust the "Decimal symbol" in "Control Panel/Regional and Language Options/Regional Options/Customize/Decimal symbol" to "." (point).

Properties
  • IniFileName: String: .ini's file name for loading/saving registration information.
    If not specified it will be automatically guessed from .exe file's name changed extension to .ini.

  • RandomSeedReg: Extended: Random seed number used when calculating a registration number (a random one is generated when you first put the component onto the form).

  • RandomSeedVer: Extended: Random seed number used when calculating a version code (a random one is generated when you first put the component onto the form).

  • RegEmail: String: Users e-mail for registration.

  • RegistryKeyName: String: Registry key name for loading/saving registration information.

  • RegistryRoot: Cardinal: default is HKEY_CURRENT_USER.

  • RegName: String: Users name for registration.

  • RegNumber: String: Users registration number for registration.

  • RegVerCode: String: Users current version code for registration.

  • SettingsStoreMode: TSettingsStoreMode: Set place for loading/saving registration information.
    ssmIniFile: .ini file specified with IniFileName.
    ssmRegistry: Registry place specified with RegistryRoot and RegistryKeyName
    If not specified it will be automatically guessed from .exe's File Description and Company field.

  • TextAppName: String: Application's name for registration text and for loading/saving registration information from/to the registry.
    If not specified it will be automatically guessed from .exe's File Description field.

  • TextAuthor: String: Application's author (company) for registration text and for loading/saving registration information from/to the registry.
    If not specified it will be automatically guessed from .exe's Company field.

  • TextOrderSite: String: Order site/company eg.: "www.shareit.com".

  • TextPrice: String: Price of the product eg.: "$25".

  • TextProductID: String: Product ID.

  • URLOrderForm: String: URL to the application's order form (order TLabel click).

  • URLRegistration: String: URL to the application's order information page ("Online" TButton).

  • VerCodeUpdateEmailAddress: String: E-mail address where the version code request e-mails are sent.


Methodes
  • Registered: Boolean: Returns the registered/unregistered state.
    Triggers: BeforeRegistrationCheck then OnRegistrationChecker then AfterRegistrationCheck.

  • Load: Boolean: Load registration info (where specified with SettingsStoreMode).

  • Save: Boolean: Save registration info (where specified with SettingsStoreMode).

  • Show: Create and show the registration form (use this whenever you can - you also need probably to set FormStyle to fsStayOnTop as Windows hides the windows if you click on another one, and on the contrary the windows isn't shown on the taskbar).

  • ShowModal: Integer: Create and show the registration form modaly (avoid using it, as this little window would stop your entire application in this case).

Events
  • AfterRegistrationCheck: Happens when the registration information's validity had been checked.

  • AfterRegistrationLoad: Happens when the registration information had been loaded.

  • AfterRegistrationSave: Happens when the registration information had been saved.

  • BeforeRegistrationCheck: Happens when the registration information's validity is to be checked.

  • BeforeRegistrationLoad: Happens when the registration information is to be loaded.

  • BeforeRegistrationSave: Happens when the registration information is to be saved.

  • OnDoRegistrationClick: Happens when the user clicks the "Register!" TButton on the registration form.

  • OnNotEnoughInfoForReqVerCode: Happens when the user clicks the "Request!" TButton on the registration form but there is no registration information entered.

  • OnRegistrationClickOrder: Happens when the user clicks the "order" TLabel (link) on the registration form. If you don't specify URLOrderForm, you can handle what to happen on click here.

  • OnSendReqVerCode: Happens when the user clicks the "Request!" TButton on the registration form to request a version code.

  • RegistrationChecker: You can implement your own registration information checker here (this will replace the built-in regnum/vernum calculator).

See the class's popup auto-complete menu while designing for all of it's properties/methodes...


Localizing the component

Copy the the form's files (RegForm.pas and RegForm.dfm) into your projects folder. You can use the Delphi's built in translator system (Menu:Project/Languages/Add.. & Menu:View/Translation Manager) to translate the component.


TRegistration in shareware and commercial software?

The component is free for use in free software. If you like it and use it in a shareware or commercial product you have to buy a license.



[Top]