[RESOLVED] Program license storage
Hello all,
I am looking for alternatives to a program licensing scheme that would allow for some specific operating conditions. The license should be by machine so that whoever logs in to that machine has access to it (i.e.. terminal server). The license storage location should be in a location that is not restricted to the most limited user and be compatible with windows new Vista OS.
In the course of my search, I came across a thread by MartinLiss that is very useful but the storage method uses GetSetting/SaveSetting which seems to be by user, requiring every user of the machine to license the program separately. I realize that I could store the license info in a file but then that seems rather transparent. Even if I encrypt the contents of the file, the file itself could be passed around. It would be the same as if I told someone the unlock code is "UNLOCK"
Now that I think about it the problem doesn't seem to be so much with the scheme of the licensing feature as much as where and how to store the info.
Thanks, Jay
Re: Program license storage
GetSetting and SaveSetting retrieves and writes information to the computers registry. Those entries will be there regardless of who is logged into the machine.
Re: Program license storage
You need to write to the HKEY_LOCAL_MACHINE hive, rather than HKEY_LOCAL_USER. For that, you'll need to use API calls to access the registry, rather than the limited GetSetting/SaveSetting. There are some demonstrations of this in our VB CodeBank section.
Re: Program license storage
penagate,
That is what I thought but won't there be issues doing that with Vista and/or being logged in as a very limited user.
Re: Program license storage
There would be issues, but I think only if the limited user tries to write to that hive - I think that reading the value will be fine.
As most programs need to be installed by an admin, you could write the value(s) as part of your installation process - many installation creators (such as Inno Setup) allow you to write to the registry while installing your program.
Re: Program license storage
Fair enough, And thank you every one. It shouldn't be an unreasonable request to require an administrator or poweruser be logged in to actually apply a license or unlock sequence as this program also involves a demo period so the licensing would be done post install.