bright, fresh software
Downloads  |  Buy

Product Key validation

Product Key validation

Postby JohnEast » May 23rd, 2011, 12:45 pm

Hi,
Is there any plan to build in some verification information into a product key? When offline, I can put in any bogus product key. I have added a general format check to avoid total garbage being entered, but it would be kind of handy to have a check-value built in so this-is1t-otal-ly2b-bogu-s6PK-ey77 is reject prior to being on the internet.

Thx
JohnEast
 

Re: Product Key validation

Postby Wyatt » May 23rd, 2011, 1:07 pm

Is there any plan to build in some verification information into a product key?


Yes, use CheckAndSavePKey(). The return code from that function will tell you if the product key is valid or not. Is this what you're talking about? Or are you talking about checking if the product key is valid on your server like in this case: SaaS and time-limited licensing?
User avatar
Wyatt
Site Admin
 
Posts: 2558
Joined: July 11th, 2007, 10:30 pm
Location: New Hampshire

Re: Product Key validation

Postby Guest » May 24th, 2011, 7:16 pm

Your first point is what I need.
However, is there any limitation or calling order when using CheckAndSavePKey()? I have a valid product key that I have activated. Is there a problem to call CheckAndSavePKey again? I get a TA_FAIL return value.

Prior to installing my product, I do a activate/deactivate to validate the product key.
CheckAndSavePKey();
IsProductKeyValid();
IsActivated();
IsGenuine();
Activate();
Deactivate(1);

This may be overkill. If I don't do the Deactivate, subsequent CheckAndSavePKey fails. Is that what is expected?




Thx,
John
Guest
 

Re: Product Key validation

Postby Wyatt » May 24th, 2011, 9:26 pm

Hey John,

Yes, if you've already successfully activated a product key, CheckAndSavePKey() will return TA_FAIL for any string (valid product key, or just a garbage string).

If I knew what you were trying to accomplish maybe I could guide you in the right direction. For instance, why are you activating just to check the validity of a product key? And why do you need multiple product keys for a single product on the same computer?

Can you give me a broader view of what you're trying to do?
User avatar
Wyatt
Site Admin
 
Posts: 2558
Joined: July 11th, 2007, 10:30 pm
Location: New Hampshire

Re: Product Key validation

Postby Guest » May 24th, 2011, 11:40 pm

Wyatt,
There is no real "need" for me to call CheckAndSavePKey() multiple times. I was doing it because I didn't know better.
So, is a Deactivate(1) all that is needed before I can (re)use another product key?

BTW, thanks for you quick response.
Guest
 

Re: Product Key validation

Postby Wyatt » May 25th, 2011, 12:18 am

So, is a Deactivate(1) all that is needed before I can (re)use another product key?


Yes, calling Detactivate(1) will both deactivate and remove the product key. Then you'll be able to use another (or the same) product key to activate.
User avatar
Wyatt
Site Admin
 
Posts: 2558
Joined: July 11th, 2007, 10:30 pm
Location: New Hampshire

Re: Product Key validation

Postby Guest » May 25th, 2011, 12:31 pm

This may be something very obvious I overlooked, but any idea why the behavior when I call the LimeLM APIs from my console installation app behaves differently than when called from my Windows service?

I am using the exact same code. My console app properly detects that my product key has been revoked. My service does not.
Right off the bat, from your description of CheckAndSavePKey(), (I call it just for fun) returns TA_OK from my console app while the service it fails.
Also, from my service, IsActivated() incorrectly returns TA_OK.

TIA,
John
Guest
 

Re: Product Key validation

Postby Wyatt » May 25th, 2011, 3:28 pm

TurboActivate activates per-user. A Windows Services is running as a different user than the console app. So let's say you activate from within the console app, when you use TA in your Service it will look like you're not activated (and vice versa). The other user can activate and it still only counts as 1 activation. So if the Console app and the Windows Service both activate using the same product key then it only counts as 1 activation within LimeLM.

We plan on making "system" level activations easier in the near future. Right now the best option is to accept a product key from whatever method (installer, text box, etc.) and verify it's valid using CheckAndSavePKey() then store it where your other components of your app can access it (e.g. your Windows Service). For instance you could store it in the HKLM registry key.


Does this make sense?
User avatar
Wyatt
Site Admin
 
Posts: 2558
Joined: July 11th, 2007, 10:30 pm
Location: New Hampshire

Re: Product Key validation

Postby Guest » May 25th, 2011, 4:36 pm

Yes, this makes total sense. Thx. Any idea when the change for a system-wide activation might take place?
Guest
 

Re: Product Key validation

Postby Guest » May 25th, 2011, 6:39 pm

Activation from my service is the "easy" part. It becomes a bit more complex to handle uninstall/deactivating process. :|
Guest
 

Next

Return to LimeLM & TurboActivate Support