This is just general stuff
My own system generates a code using the users name (they have to email to get one) and a date driven demo mode they have to upgrade the demo (downloaded) within the activation period.
That's not foolproof by any means!!
Next step up is getting serial numbers (or the user name) from the hardware and thus tying it to a computer.
Then there are the systems that use an algorithm to generate long 'keys' pseudo randomly (OK I don't know the correct term), there will be lots of 'Good' Keys, but only a tiny percentage of the total combinations of say 20 alpha numeric characters.
So the chance of getting a good one randomly is infinitesimally small, the algorithms to do this are kept a close secret of course, this is what you are paying for when getting a commercial protection package.
(As used my M$ etc)
Even this isnt foolproof, it only take one employee to leak the 'seed' and the Hackers out there will tune thier Keygens to generate good keys for an application.
I just had a look at the Innosetup web site and I think that Inno has a built in encryption algorithm (and InnoSetup is free), this will protect your installer. Of course it doesn't protect the exe once its installed.
There might be a Free Delphi component that will generate Encryption keys for you, worth a look.
Or someone ere might know how to write one? (I don't).
I would say the maths involved is going to be quite harsh.
Steve: N.M.N.F.
If something is popular, it must be wrong: Mark Twain