Why does ReadKeys still return a key after calling DeleteKeys?

When you activate a key, QLM will, by default, store the keys (activation key and computer key) in 2 locations on the system: one location at the user level and another location at the machine level. Storing keys at the machine level is only possible when the application storing the keys is running with elevated privileges. For example, if you are using the QLM License Wizard to activate keys, and you launched the License Wizard by calling the QlmLicense.LaunchProcess function, the last argument of this function controls whether to launch the process with elevated privileges.

To delete the keys stored on the end-user system, you may call the QlmLicense.DeleteKeys function. If you call this function from your application and your application is not running with elevated privileges, DeleteKeys will only be able to delete the keys stored at the user level. The keys stored at the machine level will not be deleted. Hence, calling QlmLicense.ReadKeys will return the keys stored at the machine level.

You have several options to address this behavior:

  1. Use the QLM License Wizard to delete keys. The QLM License Wizard includes the ability to deactivate a key. Deactivation of a key includes 2 steps: deactivating the key from the server and then deleting the keys from the local system. Since the License Wizard can run with elevated privileges, it will be able to delete the keys stored at the machine level.

  2. Do not store keys at the machine level. The QlmLicense.StoreKeysOptions property controls this behavior and can be set to one of these values: EStoreKeysPerUser, EStoreKeysPerMachine, EStoreKeysPerUserAndMachine (default). The drawback of this approach is that each user of a given machine will need to activate the license the first time they run your application.

  3. Store keys in the Windows Common data folder. The QlmLicense.StoreKeysLocation property allows you to control the location where QLM stores keys. The options are: registry, file system, or Windows Common data folder. By setting this property to EFileCommonData, QLM will store the license keys in the Windows CommonData folder (C:\ProgramData) where the keys are accessible to any user on the system.

Last updated