Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
CodeDelphiIDERAD Studio

Easily Add Product Licensing For Delphi Apps Using TurboPack OnGuard

TurboPack OnGuard

TurboPack OnGuard is a copy-protection system for VCL and FMX applications built using Delphi and C++ Builder.

In this article, I illustrate using TurboPack OnGuard and an integration with back-end Digital-River’s MyCommerce.

Digital River MyCommece platform is a sales ordering platform for customers to order software.

Getting Started

In the below video you can see it takes less than a minute to install OnGuard.

Swiftly install TurboPack OnGuard in less than a minute



Step 1. Select Tools > GetIt Package Manager, as seen below.

GetIt OnGuard

When the GetIt Package Manager Window appears (shown below).
1. type in “onguard”.
2. Click on the Install Button.

Get It OnGuard

After installation, go to the Component Palette. Scroll to the bottom, you should see OnGuard, with all the registered components.

1. OnGuard VCL components

OnGuard Components

My First Licensed App

A sample copy-protected app takes around ~ 5 minutes to make.

Using TurboPower OnGuard, you first create a Key. You can right-click on an OnGuard component and click the “Generate Key” menu.

Generate Key OnGuard

This will bring-up a Key Maintenance Dialog Box.
1. If you have not created a key. click the Button with Folder picture, to save the OnGuard key to disk.
2. If this is your first time, click the “Add…” button to generate a key.
3. Optional – copy Key to Clipboard.

OnGuard Key Window

If you selected [2] from the previous Dialog box, you will go to this small dialog box. Click on the Key Button to generate a key.

OnGuard Add Key

Errors Occurred during Development

OnGuard Error

You need to add code to the Component Event OnGetKey:

Then, add code to Event GetCode:

Integration with Digital River Back-End

After your first sales, you find, you need to manually issue keys for your customer. If you have many orders, this becomes time-consuming affair. Wouldn’t you wish this could be automatic?

Digital River’s Admin Panel allows Delphi Console-Based VCL App to generate keys to be uploaded!In the below, a Key Issuance console app – digitalriver.keyissuance.yourapp.dpr does the job:

You need to replace PROD constant with the Product SKU ID from Digital River’s Admin Panel.

The CKey is same as embedded in your app.

There is a small test-case included in the source-code –

After compiling the Key Issuance Delphi console application, upload it to Digital River’s Administration Panel.

The below shows example invoice (* certain information redacted as it is test invoice)

2020 12 20 6 07 10 1837315
Test Invoice Page 1
2020 12 20 6 09 42 3192194
Test Invoice Page 2

Entering Data from into the Demonstration App, the app is licensed –

OnGuard Example

OnGuard also works with Chinese, Korean, Thai and Arabic Names –

OnGuard Example

The source-code for this demonstration project is at https://github.com/PolywickStudio/OnGuardRecipe.

Also check out Embarcadero GetIt for more information about TurboPack OnGuard and then install it via the IDE.

See What's New in 12.2 Athens See What's New in 12.2 Athens Dev Days of Summer 2-24

Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

About author

Technical Director at Polywick Studio, a top-rated Upwork company. I have over 10+ years of experience using Delphi. I am a member of the Add-in-Express ADX Team,

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Worth reading...
Easily Manipulate Text With The FlashText Python Library In A Delphi Windows App

IN THE ARTICLES