License validation at startup is late

Hello,

LexActivator.IsProductActivated () is executed at startup.

If it is online, this method is completed in about 1 second.
However, in case of offline, it may take more than 3 seconds each time.

Why does it behave like this?
Communication at startup is every number of days specified by LexActivator.SetDayIntervalForServerCheck (), during which we do not communicate.

It takes time only at least at the first startup.
If you use it incorrectly, please tell me how to use it properly.

The program at startup we created below is below(C# program).

var status = LexActivator.SetProductFile(m_ProductFilePath);
if (status != LexActivator.LA_OK)
{
return false;
}
status = LexActivator.SetVersionGUID(m_VersionGuid, LexActivator.PermissionFlags.LA_USER);
if (status != LexActivator.LA_OK)
{
return false;
}
status = LexActivator.SetUserLock(true);
if (status != LexActivator.LA_OK)
{
return false;
}
status = LexActivator.SetDayIntervalForServerCheck(14);
if (status != LexActivator.LA_OK)
{
return false;
}

// this method is too late!
status = LexActivator.IsProductActivated();
switch (status)
{
case LexActivator.LA_EXPIRED:
case LexActivator.LA_GP_OVER:
case LexActivator.LA_REVOKED:
return false;

case LexActivator.LA_OK:
	return true;

default:
	return false;

}

Hi,

IsProductGenuine () function does server sync in a separate thread, hence network request for server sync won’t add to the time.

It however queries WMI of your operating system to fetch the details of hardware to compute the fingerprint, which usually happens within a second.

SetUserLock () if used, should be invoked before SetVersionGuid().

Hello,

In some cases, may it take more than 3 seconds with queries WMI?
We have a problem that it takes 10 seconds if you launch an application offline on a specific computer.
Changing the startup sequence is only license validation, and license validation is the only function that depends on the network state.
Therefore, I think that something is caused by IsProductActivated ().

If SetUserLock () was called before SetVersionGUID (), SetUserLock () returned LA_E_GUID.

I doubt it would ever take 10 seconds, in our testing it takes less than one second, ActivateProduct () function does a network request in the main thread, so it may take time, but IsProductGenuine () uses a separate thread.

How are you calculating the time taken by the IsProductGenuine () function?

Hi,

The problem was in a different part from the activation.
I’m sorry.
However, it may take 1.5 seconds after OS startup.
As for this, I look forward to improvement in the future.

Thanks.

Just wanted to confirm that you can’t SetUserLock before SetVersionGUID, because it would throw LexActivatorException: The version GUID doesn’t match that of the product file.
I’m currently dealing with some other problem, but I think this may be useful for somebody else who finds this thread.