DeactivateLicense clears License Key (but LA_E_REVOKED does not)

Hi

When a license is deactivated, all the local license information is cleared, including the license key. After deactivating a license, GetLicenseKey therefore returns an empty string.

There are however many scenarios where a user might want to deactivate a license on a machine, only to reactivate it again later. But the fact that the license key has now been cleared from that machine makes it difficult to reactivate however, as the user now needs to go and look for the email or the document that contains the license key and then has to enter the key again.

However, when ActivateLicense or IsLicenseGenuine returns LA_E_REVOKED, the local license information is also cleared, but the license key is not. This doesn’t really make sense to me, as a revoked license would probably never be activated again so there is no need to keep the key on the local machine, but that’s not the point. Perhaps it was done this way so someone (perhaps a support person) could ask the user for the key at a later stage, to see why it was revoked or whatever - I don’t know.

But would it then not make sense for DeactivateLicense to do the same thing (or at least something similar)? Could the DeactivateLicense function not be updated to take a Boolean parameter that indicates whether or not the license key should also be cleared on the local machine following deactivation? This parameter could be True by default, so it doesn’t break existing code.

Example: DeactivateLicense(ClearLicenseKey: Boolean = True)

At least then I can choose if I want to keep the local license key after deactivation for easy reactivation later.

Thanks

Hi @deonvn

But would it then not make sense for DeactivateLicense to do the same thing (or at least something similar)? Could the DeactivateLicense function not be updated to take a Boolean parameter that indicates whether or not the license key should also be cleared on the local machine following deactivation? This parameter could be True by default, so it doesn’t break existing code.

This is the default behavior in case of hosted floating licenses. In case of node-locked during the deactivation you can first store the key locally and after calling DeactivateLicense() you can set the key using the locally set variable again using SetLicenseKey().

1 Like

OK - I guess that’s easy enough. I’ll do that.

Thanks