Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Closed Thread
Thread Tools Display Modes
Old 11-02-2017, 06:37 AM
tcsh tcsh is offline
Join Date: Sep 2016
Posts: 33
Exclamation Need tutorials to make a licensing system


Can anyone recommend some well written tutorials/documentation you've come across that talks about how to make your own licensing system to use in your Delphi software?

I would love to try and make my own to use in my application rather than buying an existing one.

Would love links and any other thoughts on the matter you would have, appreciate it.
Old 11-02-2017, 11:31 AM
Norrit Norrit is offline
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,307

Making licensing software is a sport on it's own.

There are 10.000 ways to implement, and all of them have their pro's and con's.

And what is licensing in your oppinion?
- Limit number of (concurrent) users
- Limit functionality (time trial?)
- Limit by adding commercials?
- is it just slower (yes, I've seen trials that have build a Sleep in the unregistered)?
- Whatever you can think of...

And do you want to work with:
- License key that you distribute (but how do you tackle the 1 key given to other users?)
- License file (with some specific computer information, which also has downfalls on migration)
- Online license (note that your application won't work if no internet access or your server is down)
- UID key license?
- Some other obscure method (or just a combination of some methods given above)?

And licensing is 1, but usually interacts directly with some functionality of your application.
For example:
- is it a modular based license?
- is it a user based license?
- is it a combined (modular and user) based license?
- some other type you can think of?

And this is just what I came up with in 2 seconds, there are more and more questions that rise when diving into something seamingly easy as "licensing system"

Before you go in too deep I would suggest writing down your requirements. There are no tutorials/documentation that will cover all, so you must search for specific requirements individually and combine them into some solution that works for you.
But again, this is a whole new sport. Perhaps reconsider writing it yourself?
Old 11-03-2017, 01:52 PM
tcsh tcsh is offline
Join Date: Sep 2016
Posts: 33

Hey there, thanks for your reply.

I already had a layout in my mind, for some reason It didn't occur to me to include them in my initial post (which now sounds really dumb lol)

The various software I plan on releasing will be distributed per user. I'd love to use an online license and yes, as you state, the application shouldn't work if no internet connection or my server is down, this is ideal. Similarly, shouldn't be able to allow multiple users on the same license (as you stated, concurrent) and I'm still undecided if I will release trials or not (which would bring up the need for time trial, like you stated)

From some of the things I've read so far I can use HWID, country/language locks to ensure the license stay on intended machine/user. I'm not concerned of migration, I'll handle those situations manually when they arise and double check the user then (for resetting hwid's and so forth)

Software won't be that public, or rather, it won't hit a large user base, it's more of a niche thing.

Ideally I'd love to be able to develop and deploy a sort of web panel on a server where I can check everything. Issue license keys, ban them, suspend them, maybe add validity time to them, see the various users that are connecting/using the software/are online and the various things I'll log about them (hwid, ip and other such logs)

This is obviously possible since I've seen a lot of these services but for .NET. Since I'm new to it, I'm not sure how and it what way they would differ when used on a piece of software developed in Delphi, rather than .NET

My only concern would be module licensing in my software. For example, I'd love to just be able to revoke certain modules in the software so the user can't use them. For example's sake let's think of the software having 5 tabs (sections) each containing various things with various functions. I'd love to be able to sell it on a module bases, meaning selling with 2 of the tabs and if at anytime of use the user decides to purchase one of the other 3 remaining tabs (hence functionality) I could just add that to their license, the software being then able to show the tab and make it available for use.

Obviously not looking for code or complete examples or such, just a nudge in the right direction as I'm having difficulty pin poiting exact needs to develop this. I'm not native english so that might be my problem (keyword search combos)

So, basically, upon reading my (hopefully adequate) example anything you can link, guide, provide in this direction in terms of reading and so learning to eventually be able to do this myself, I would appreciate it. Any specific things you imagine I'm gonna bump into and would require resources to learn it. Based upon your recommendations, I'll eventually work my way to the end goal.

I realize, somewhat, the magnitude and yes I will probably end up using, at least for a time, an already available commercial solution but nevertheless I eventually plan on learning to code one of these systems myself, and use it.

Might as well start learning now, to that end.

Old 11-06-2017, 08:58 AM
Norrit Norrit is offline
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,307

According to your requirments, easiest is to create a rest/soap service which does the validation serverside. REST has less overhead then SOAP, therefor I would suggest REST. At a later stage you can attach an SSL and bind it on IP addresses to be more secure, but that's not needed for development.
In this you can have your own methods.

For example (Hardware Id is optional, just added it to show the basic thought), function GetAvailableModules(LicenseKey, HwID: String): TModule;
Or something similar.
Serverside does all your validations, so for each call clientside you could validate using a function IsModuleActive(LicenseKey, HwID: String; Module: TModule): boolean;

So clientside you should build your validation request and adjust your UI accordingly. What I would do extra is make a call to your validation service each time you do a Save to your clientside db (assuming you have any). Depending on how your clientside software is build this will take more or less easy. What you should avoid is adding the call at each line of code. You want a generic Save method (or generic build your screen method) that does this extra validation. This normally means some heavy refactoring of your existing code. If it's just a small app you could start by just adding the extra line of code, but at the end you would like some middleware validation.

You can build your own serverside application that communicates directly to your validation/licensing db. But that's at the latest stage, first you need your validation service and clientside to communicate with it and handle upon it.

As you have the basics from there you can build in many more validations, rules, whatever you like. But the idea is to start as simple as possible and restrict it from there.

NB: Syntax could be a bit off, because I don't do Delphi that much anymore. But I hope you get the basic idea

So for starters you'll have to sum all possible areas on which you think you run into. This has not so much to do with tutorial for licensing as more for tutorial on building and consuming REST/SOAP. This is somewhat Delphi version specific if you do it using the Indy components. And if you use the Indy components you'll have to distribute some dll's extra.
Getting the HwID is a quick google.
Old 11-08-2017, 03:00 PM
tcsh tcsh is offline
Join Date: Sep 2016
Posts: 33
Thumbs up

Appreciate the answer, thank you!
That should get me started
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

All times are GMT. The time now is 08:04 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2018, vBulletin Solutions, Inc.