Programmatically Detecting Whether a Trial Has Been Started Without Starting a Trial Indirectly

We're using the Java API with TurboActivate. I'd like our application to perform a check for whether a Trial has been started without (indirectly) starting a trial. My understanding is that TrialDaysRemaining() can only be called after UseTrial() has previously been called. UseTrial() will automatically start a trial the first time it's called.

Is there a way to detect whether a trial has started without actually starting one?

A secondary question is whether there's any way to *forcibly* stop/terminate (or reset) a trial? I suspect there is not (other than completely wiping the machine), but wanted to ask just in case.

We use TA on both Windows and Linux and all of our application use cases are non-VM based.

Hey David,

TA_GetDaysRemaining() will return TA_E_MUST_USE_TRIAL (or throw the MustUseTrialException) if UseTrial() has not yet been used.

>> "A secondary question is whether there's any way to *forcibly* stop/terminate (or reset) a trial?"

Nope. But you can extend trials for any customer: https://wyday.com/limelm/help/trials/#extensions

Perfect on the first answer, thx!

Yes, I realize I can extend a trial - can I enter a negative value for the extension 😉 ? I'm trying to find a way to forcibly limit an ongoing, verified trial.

No, there's no way to shorten a trial. You can offer a 0-day trial, and then only give trial extensions to customers that you want.

Follow-up on this one:

Is there a way to detect whether a trial has previously expired without attempting to start the trial? Currently, when TrialDaysRemaining() is called after a trial has expired MustUseTrialException is thrown (this is the same exception that's thrown when a trial hasn't previously been started). Attempting to start a trial at this stage results in TrialExpiredException being thrown.

I'd like to be able to detect an expired trial without calling UseTrial(), since this will start a trial when a trial hasn't previously been started (and I'd like to provide the user feedback regarding this - i.e., whether a trial has expired or whether a trial has not yet been started without having to call UseTrial() first - I do use TrialDaysRemaining() for the latter case, but not the former).

>> "Currently, when TrialDaysRemaining() is called after a trial has expired MustUseTrialException is thrown (this is the same exception that's thrown when a trial hasn't previously been started). "

Well, only on a machine that has been "wiped". For real world use-cases calling TrialDaysRemaining() will get you the number of days remaining. It won't throw MustUseTrialException() unless you haven't actually called UseTrial() on that computer (or the trial length on the servers is 0).

Not in my case: I have a desktop machine that *hasn't been wiped* but that has an expired trial (by ~10days). The initial call to TrialDaysRemaining() throws MustUseTrialException.

I think your comment is contradictory in that you indicate TrialDaysRemaining() won't throw MustUseTrialException "unless you haven't actually called UseTrial()", which, of course, I have given that the trial has expired (it can't expire without having first called UseTrial() 😉).

So, again, my question is whether I can determine whether a trial has expired without having to call UseTrial() (which has the side effect of starting a trial if a trial hasn't yet been started on the machine)?

Hi Wyatt/Sam, just checking in to see if you had any ideas on this? Thx.

OK, I think I see what I was missing here. Indeed, I do see TrialDaysRemaining() return 0 when a trial has expired. The problem arose from the fact that I assumed this method would throw (MuseUseTrialException) when a trial has expired; this is not the case (as you indicated) and I was seeing this only after a subsequent call to UseTrial() (which is expected). The call to UseTrial() was not supposed to be happening because it was assuming the prior TrialDaysRemaining() call would throw....

However, I'm now in a new situation I'm not understanding. Specifically, I see the initial call to TrialDaysRemaining() return 0 (expired trial), but the subsequent call to UseTrial() succeed. Is this expected? No new (trial extension) key is installed and in this case I would have assumed that UseTrial() would throw TrialExpiredException().

>> " but the subsequent call to UseTrial() succeed. Is this expected?"

Yes.

>> "[...] in this case I would have assumed that UseTrial() would throw TrialExpiredException()."

No, if the UseTrial function only throws the TrialExpiredException() when there's no trial remaining on a "clean" or "cleaned" machine.

So, if UseTrial() throws TrialExpiredException you know there's no more trial days left. If it doesn't throw an exception, then you know you can continue and call TrialDaysRemaining to see how many days left there are. TrialDaysRemaining will return 0 or greater days left.

Sam wrote:> >> "[...] in this case I would have assumed that UseTrial() would throw TrialExpiredException()."> > No, if the UseTrial function only throws the TrialExpiredException() when there's> no trial remaining on a "clean" or "cleaned" machine.

I'm not following what the distinction is here. What do you mean by "clean"/"cleaned" machine? I don't follow when UseTrial() would ever throw TrialExpiredException() on a "clean" machine (if understand what you mean by this). On a clean machine, the first call to UseTrial() should *start* a trial, no? Independent of whether TrialDaysRemaining() is ever called I would have thought that UseTrial() would throw TrialExpiredException iff a previously started trial has expired.> So, if UseTrial() throws TrialExpiredException you know there's no more trial days> left. If it doesn't throw an exception, then you know you can continue and call> TrialDaysRemaining to see how many days left there are. TrialDaysRemaining will> return 0 or greater days left.

In my case (see the very first post in this thread) I would always like to call TrialDaysRemaining() first (in order, again, to prevent inadvertently starting a trial when calling UseTrial() first and in the case where the trial hasn't already been started). So, I believe I this would mean that TrialDaysRemaining() always either returns #days (>=0) or throws MustUseTrialException(). In the latter case a trial has never been started. In the former case a returned value of 0 means a trial was previously started, but that it's now expired, and a value >0 means the trial is active with <x> number of days remaining.

In the MustUseTrialException() case a subsequent call to UseTrial() will begin the trial.

Do I have this right?

Just checking in to see if anyone had a response to my previous post?Thx.

>> "I'm not following what the distinction is here. What do you mean by "clean"/"cleaned" machine? I don't follow when UseTrial() would ever throw TrialExpiredException() on a "clean" machine (if understand what you mean by this). On a clean machine, the first call to UseTrial() should *start* a trial, no? "

Yesproviding the following cases are true:

1.That a trial has never been started on that physical hardware. I.e. the customer hasn't "cleaned" the trials data files and thinks the trial will reset. It doesn't work like that. Even if the customer re-installs Windows on the machine (or Linux, MacOS, etc.)TurboActivate and LimeLM are smart enough torecognize the machine and start where the trial has leftoff --even if that means 0 days are left.

2. That you have more than 0 days as the length of the trial in LimeLM.

>> "Independent of whether TrialDaysRemaining() is ever called I would have thought that UseTrial() would throw TrialExpiredException iff a previously started trial has expired."

No, UseTrial() will only return TrialExpiredException when there are 0 days left on the server and it's a "clean/cleaned" machine.

>> "So, I believe I this would mean that TrialDaysRemaining() always either returns #days (>=0) or throws MustUseTrialException()."

Yes, that will work.