License expirtation

Hello,

We have had a few occasions of customers reporting a license expiration message when the license should have been active. We have contacted you before in this regard. But what I need to gather from you in this post is some technical information about how license is detected so we can figure out what the root cause of problem could be.

If you don't want to post the answer in the forum please let me know and I will give you direct contact.

Our questions:

- Storage location where the license is written to - What are the factors that could affect a license? We have customers who are changing their network settings, and are wondering what type of change could affect their license.

Appreciate your help and detailed info in this regard.

Best,Fereshteh

One more question:

- Are there any known utilities/processes that end up removing the license data? We think that somehow license data is being removed.

I need a lot more information to help you:

  1. Before you do anything: are you using the latest version of TurboActivate? If not, get that first, and then try again. We fix bugs all the time, and there's not a whole lot of point in trying to re-find bugs we've already fixed.
  2. Next, only after doing step 1, what do you mean by "expired". What function are you running? And what is the exact error code?
We have customers who are changing their network settings, and are wondering what type of change could affect their license.

Don't disable network adapters. There's never a reason to. It provides exactly no benefit, and only causes problems.

Hello,

Yes, we are indeed running 3.4.6.

A couple of scenarios:

- To check the status, for offline activations we call IsActivated or for online activations we call IsGenuine

- In either case if we get TA_E_ACTIVATE or TA_FAIL as the return code and report that the license status is Expired.

- From within the product, for the offline case we just call IsActivated and for online cases we call the following:

GENUINE_OPTIONS options;options.nLength = sizeof(GENUINE_OPTIONS);options.flags = 0;options.nDaysBetweenChecks = 30;options.nGraceDaysOnInetErr = 7;hr = ::IsGenuineEx(LIMELM_VERSION_GUID, &options);

In this case if we get TA_E_ACTIVATE or TA_FAIL we report expired status.

Don't use IsActivated() at all. Just use IsGenuineEx() and use the TA_SKIP_OFFLINE flag like the example program shows. For more information about TA_SKIP_OFFLINE see TurboActivate.h:

/* If the user activated using offline activation   (TA_ActivateRequestToFile(), TA_ActivateFromFile() ), then with this   flag TA_IsGenuineEx() will still try to validate with the LimeLM   servers, however instead of returning TA_E_INET (when within the   grace period) or TA_FAIL (when past the grace period) it will   instead only return TA_OK (if IsActivated()).


   If you still want to get the TA_E_INET error code, without   deactivating after the grace period has expired, then use   this flag in tandem with TA_OFFLINE_SHOW_INET_ERR.


   If the user activated using online activation then this flag   is ignored.*/#define TA_SKIP_OFFLINE ((uint32_t)1)
- In either case if we get TA_E_ACTIVATE or TA_FAIL as the return code and report that the license status is Expired.

OK, well, that's wrong. A better handling is listed here, and will be included in TurboActivate 4.0 and newer as part of the example code: https://wyday.com/forum/t/3013/isgenuineex-returns-an-eror-while-is-isactivated-doesnt/#post-14766

Hi there,

Thanks for the clarification and example, extremely helpful!

Just to verify that we've got the right logic here's the code we're now using (see Gist linked to below). Note that we used to separately maintain the state of whether the activation was online or offline. Formerly we called IsActivated for offline states which as you said is incorrect. We now call IsGenuineEx with the TA_SKIP_OFFLINE flag in all states (online or offline) and rely on IsGenuineEx to sort out the correct online vs. offline behavior.

Here's our core licensing logic updated with the techniques you suggested:

https://gist.github.com/jjallaire/15faf93bf588a3f1dd1b

Thanks again for your help and let us know if you see anything we're still doing incorrectly.

Thanks,

J.J.

// if we still have local activation data then this is an // error resulting from inability to communicate with the // activation servers if (isActivated()) printInternetRequiredWarning();

Well, that's not right. Because they'll just get an infinite loop every time they open your app they'll get that for the next 5 hours. You need to let the user re-try with the activation servers. See our updated example.

Not sure what you mean about an infinite loop. This code is called periodically (either by the user at the command line to query status or ~ once every 24 hours in the background to re-confirm license status). If it fails in the first instance the user just sees an error message, if it fails in the second instance the product stops working (until they reactivate).

Perhaps what you mean by infinite loop is that the call to IsGenuineEx will fail for the next five hours? (re-reading your reply that's pretty much what you said). In your example you prompt the user on the spot and call IsGenuine to force communication with the activation server. Since I can't do this in at least one of my cases I'm wondering if the following would work:

1) When I detect the failure to communicate with the activation servers (the if branch you quoted in your reply) I set a persistent flag (i.e. in a file) indicating that the next communication with the activation server should use IsGenuine.

2) When I get an OK status again I reset this flag so that subsequent activations use IsGenuineEx.

Does that make sense?

One other possible variation I thought of but wanted to confirm I'm understanding the exact states.

In the code snippet you commented on (the call to isActivated after the failure of IsGenuineEx: https://gist.github.com/jjallaire/15faf93bf588a3f1dd1b#file-limelm-cpp-L21-L25) my understanding of the current state is this:

1) The user has activated online

2) We can't communicate with the server over the internet

3) The internet grace period has expired

4) The user is now unable to use the product for 5 hours even if they reconnect to the internet.

5) However, the user explicitly re-activates (via a call to the Activate API) then they can use the product again.

If this is all correct I think it might be okay for me to fail hard (and accept the 5 hour issue) as this reflects a state where repeated attempts to connect (throughout the grace period) have been made and failed. In this case I don't really mind telling the user that they need to re-activate (and therefore wouldn't need the flag setting and call to IsGenuine I described in my last post).

Am I thinking about this correctly?

Sure, that's another way to handle it.

Hi,

Here is one specific issue we are seeing, with an active license.

1) We call CheckAndSavePKey with the key KYU7-YW8C-UPDE-MPP5-QH7Z-7ATA

2) The return code is TA_FAIL even though in our dashboard it shows that this key should still be okay.

We don't understand why this is happening. Appreciate any info you could provide in this regard.

Fereshteh

CheckAndSavePKey() does not accept a new product key if IsActivated() returns TA_OK. You must first deactivate. Also, the example code linked to multiple times in this forum thread is designed so that the user won't run into this problem (because the error won't say "Expired" or "You're not activated", it will say "You're activated, but you need to reverify with the serves before you can continue").

Make sense?

Sorry, I might have not been clear. We are not using a new key. This key: KYU7-YW8C-UPDE-MPP5-QH7Z-7ATAwas activated on a particular server and was working. All of a sudden it stopped working (showing Expired). When we try to activate the same key on the same machine by calling CheckAndSavePKey, we get TA_FAIL code returned.

If it really is the same key and IsActivated() is returning TA_FAIL (which I don't know if you can determine from your current code), then the problem is that the customer's computer has changed and/or the customer is trying to install your app on another computer. Increase the number of allowed activations for the product key (if that's what you want to do).

I need to correct my previous posting; I had made a mistake. They key was incorrect in that case.

But se still have the issue that license shows status of Expired (for no reason) and activating or deactivating it does not work.

Another correction/clarification: I don't think we have any outstanding issues (the secondary issue we posted was explained by the incorrect product key).

I expect that our updated logic (based on your example) will overcome the previous issues we saw in the field.

Thanks again for all your patience and help in sorting out the right behavior.