So, I have a problem.
When my application is started it first checks whether it is already genuine. Because I have user lock, this is executed right at the start:
LexActivator.SetProductFile(productDatPath);
LexActivator.SetVersionGUID(guid, LexActivator.LA_USER);
LexActivator.SetUserLock(true);
If there was no valid licence, the application falls back to a verified trial.
If the verified trial has expired, then the application runs in a very limited mode.
Once the application has loaded, the user may enter a trial extension key.
However, because I have already done LexActivator.SetUserLock(true), key extension always fails:
LexActivator.ExtendTrial(key) returns 1
Because I have been told that SetUserLock() must be executed right after setting the GUID, I am now at a loss at the order of commands to execute in this particular case.
Any ideas?
Also a few addon questions:
Can I terminate the extended trial (without deleting origina expiredl trial)? I need this to test try to extend the trial again.
Should extending trial work while current trial extension has not yet expired (given that total trial extension length is not longer than the original initial trial)?
The trial was expired. The trial extension key was shorter than the original trial.
All I had to do to make it work is comment out LexActivator.SetUserLock(true)
For clarity, I have been trying same product, same OS, same user, same extension key, all within one 30 minute window. The only difference was that extension was failing if LexActivator.SetUserLock(true) was used before trying to extend the key in that JVM instance.
Please look into this, it is paramount for us that both features work.
But then the initial trial period on the new product will last at least a day, and only then I can try to test trial extension. Am I missing something?
I can’t get the trials to extend reliably. For example, I am trying to extend it right now. The original trial has expired. The extension has also expired. I have created another extension key for 1 day, but when I try to extend, it returns status code 1.
It isn’t very informative… What could be the reason for failure?
Should it be possible to extend a trial that has already been extended (and expired again)?
Um, I don’t understand what you mean. I don’t pass any pointers in Java. I use the Java API provided by Cryptlex.
This is the method in the LexActivator class provided by you:
/**
* Gets the number of remaining days after which the license expires.
*
* @return Returns the number of days
* @throws LexActivatorException
*/
public static int GetDaysLeftToExpiration() throws LexActivatorException
{
int status;
IntByReference daysLeft = new IntByReference(0);
status = LexActivatorNative.GetDaysLeftToExpiration(daysLeft);
switch (status)
{
case LA_OK:
return daysLeft.getValue();
case LA_FAIL:
return 0;
default:
throw new LexActivatorException(status);
}
}
So, it is supposed to return the number of days left. And it returns 0 instead of 3 days shown on the control panel.
If I insert this code into your API method:
System.out.println("status = "+status);
System.out.println("daysLeft = "+daysLeft.getValue());
It prints
status = 1
daysLeft = 0
So, the problem is that instead of the number of days it returns an “unknown error”.
Could you explain please why this is happening?
We have to do a release very soon, and this trial+extension issue is really becoming a problem.
I thought you were using the C - API. The usage is correct in Java.
The reason it’s not returning the correct value is you might have changed the trial length in the dashboard, but didn’t download the updated product.dat file.
Hi, can you please confirm that updating trial lenght no longer requires an updated product.dat file?
I just tested a) issuing a new trial policy (after deleting the old one) with longer time lenght, than b) reset() the machine locally and finally activating the new trial using the old product.dat.
Surprisingly the activation was successfull, with the longer time lenght and not requiring an updated product.dat.
Note: if relevant the local machine is running linux on Win10/ WSL2 and I’m using python.
Thanks!