The Licensing Component's purpose is to obtain a license key bound to the end user's system. It performs the following functions:
- Obtains the Hardware Key of the End User system.
- Sends a request to the licensing authority (either Deployment Licensing Service or Deployment Proxy Service).
- Stores the License Key into the registry on the end user machine.
As mentioned in the section on Licensing Administration, you can set up the Deployment Proxy Service on your Web site and program the Licensing Component to communicate with the Deployment Proxy Service instead of the Deployment Licensing Service.
Also, using the Licensing Component you can set up different custom End User licensing scenarios. For example, directing end users to come to a Web application hosted on your Web site to get a License Key.
The Licensing Component implements licensing via the following API.
ConfigPath
Property ConfigPath of BSTR type.
This property is used to set and get a path to the deployment configuration file.
The Licensing Component has to be initialized with the path to the "config.txt" file before it can perform any of its functions. The "config.txt" file is provided to you by Accusoft Corporation for each ImageGear-based solution. You need to distribute it with the Licensing Component in order for the component to work.
GetEvalPeriod
HRESULT GetEvalPeriod ([out, retval] long* EvalPeriod)
This method obtains the remaining time on an evaluation (in days). Returns EvalPeriod < 0 in case if the evaluation period is expired.
GetHdwKey
HRESULT GetHdwKey ([in] BSTR accKey, [out, retval] BSTR* hdwKey)
This method obtains a hardware key from the current machine and returns it (as hdwKey).
If you choose not to distribute individual access keys, you need to provide the accKey argument as an empty string.
GetLicKeyAuto
HRESULT GetLicKeyAuto ([in] BSTR accKey)
This method obtains a License Key for the end user's system using the automatic scenario. It takes an Access Key as its input parameter, and stores the obtained license key in the registry.
If you choose not to distribute individual access keys, you need to provide the accKey argument as an empty string.
LicenseInfo
Property LicenseInfo of BSTR type
This property is used to transfer license information into new system hardware.
To transfer the license information into new system hardware, do the following:
- Get the LicenseInfo value and store it in a safe place.
- Change the system hardware.
- Set the LicenseInfo to the value you saved in step (1).
- Run the GetLicKeyAuto method (or it's manual analog) to obtain a license for the new system hardware.
LicKey
Property LicKey of BSTR type.
This property stores the License Key to the registry when it is set, and reads it from the registry during the get operation.
ResultCode
Property ResultCode
This property can be used to contain any of the error codes described in Licensing Component Error Codes and Messages.
ResultString
Property ResultString
This property contains the string descriptions of errors.
SrvURL
Property SrvURL of BSTR type.
This property is used to set and get the URL path to the licensing web service. The default is the URL path to Accusoft Corporation's Deployment Licensing Service.
StartEvalPeriod
HRESULT StartEvalPeriod()
This method sets an evaluation licensing mode for the product and starts an evaluation period. This method is provided so you can distribute an evaluation version of your application, without having to distribute Access Keys to people who would like to evaluate your software. Using this method you can license ImageGear on the end user's system for a limited time a the default is 30 days, but it can be customized per request to Accusoft Corporation. If the evaluators purchase your software, you can then issue them an access key using either the automatic or manual scenarios to obtain a permanent ImageGear license, just as Accusoft Corporation does for its evaluators.