Delphi Software Licensing

Hello World

To add license checking to a Delphi application you add a single unit file to your using statement. You can then call the checkLicense function to load the license information and check that the user has a valid license. You need to specify a folder location for the license file, your developer password string, the license key issued to the user and the name of the application.

uses IniFiles, NuvovisLicensing;

var
  Config: TIniFile;
  Key: String;
  Status: TLicenseStatus;
begin
  Config := TIniFile.Create('HelloWorld.ini');
  Key := Config.ReadString('License', 'Key', '');
  Status := checkLicense(PChar('.'), PChar(PWD), PChar(Key),
         PChar('Hello World'), PChar(''), PChar(''));
  if Status <> LICENSE_OK then
  begin
       WriteLn('ERROR: ' + getLastError);
       ExitCode := 1;
       Exit;
  end;
  {...}

Building the Example

The library download includes a Delphi example application showing the use of the software licensing library with the developer password for the free test drive environment. Download the Nuvovis package for Windows from the settings page and extract it to a work folder. Browse to the delphi/HelloWorld folder and open the Delphi project file and build the project.

Creating a License

The example cannot run until we have created a license for the application. In the web portal click on the New button to create a new Software License. Change the client field to one of the customer names and the product name to "Hello World". Save the new license to store the new license in Genux-B. The new Software License will now have a License Key field value. In the folder where the executable was written open the HelloWorld.ini file with a text editor and copy and paste the license key into the ini file and save the file.

Now our application is licensed and we can use it. After running the test application use the web portal to see that the license has been used by clicking on the license id link in the license list view for the new Software License.