Frequently asked question

What are the methods for using an ASR file?

Last Published: April 25, 2020

Answer



** Internal Publish Only! This article may contain information that is not intended for external circulation. **



ASR-related interfaces: The IAuthorizeLicense COM interface provides the following methods for using an ASR file:

AuthorizeASR AuthorizeASRFromFile DeauthorizeASR DeauthorizeASRFromFile RepairASR RepairASRFromFile CheckASR CheckASRFromFile get_FeaturesAdded get_LastError

The ASR can be located on disk or hard-coded as a string into the source code of the developer’s application. The methods with the “FromFile” suffix handle the former case. If you wish to embed the ASR text as a string, be aware that the ASR text sequences are large and may include several thousand characters for each license feature being authorized.

The developer’s Esri-provided ASR password is a required parameter for each of the authorize, deauthorize, and repair methods.

All of the ASR-related methods return a standard “HRESULT” value.

Authorizing using an ASR: The authorization process applies the license fulfillments contained within the ASR to the local machine:

1) Authorization sequence with ASR file on disk:

CoInitialize(NULL); IAuthorizeLicensePtr pAuth; pAuth.CreateInstance(CLSID_AoAuthorizeLicense); HRESULT hResult = pAuth->AuthorizeASRFromFile(_T("<path_to_asr>"), _T("<password>"));

2) Authorization sequence with ASR embedded, as a string, within the application:

CoInitialize(NULL); IAuthorizeLicensePtr pAuth; pAuth.CreateInstance(CLSID_AoAuthorizeLicense); HRESULT hResult = pAuth->AuthorizeASR(_T("<asr_string>"), _T("<password>"));

3) If desired, the instance of IAuthorizeLicense may also be used to check which features have been authorized.

BSTR featuresAdded; hResult = pAuth->get_FeaturesAdded(&featuresAdded);

Deauthorizing/Transferring an ASR’s license fulfillments: Deauthorization involves removing the ASR-generated license fulfillments from a machine.

Deauthorization should be performed when a client has agreed to decommission the use of a single machine running the OEM application. Deauthorization should also be used in a case where the client is choosing to transfer their single use authorization to another machine, meaning their licenses would be deauthorized on the original machine then authorized again on a separate machine to run the OEM application.

1) Deauthorization sequence with ASR file on disk:

CoInitialize(NULL); IAuthorizeLicensePtr pAuth; pAuth.CreateInstance(CLSID_AoAuthorizeLicense); HRESULT hResult = pAuth->DeauthorizeASRFromFile(_T("<path_to_asr>"), _T("<password>"));
2) Deauthorization sequence with ASR embedded, as a string, within the application:

CoInitialize(NULL); IAuthorizeLicensePtr pAuth; pAuth.CreateInstance(CLSID_AoAuthorizeLicense); HRESULT hResult = pAuth->DeauthorizeASR(_T("<asr_string>"), _T("<password>"));

3) The ArcGIS Administrator may be used to verify that the appropriate license fulfillments have been removed from the machine.

Repairing broken license fulfillments using an ASR: The Repair process involves removing broken license fulfillments from the machine, and reauthorizing or reinstalling them from the original ASR.

ASR-generated license fulfillments can break in the event of a major hardware upgrade. If enough aspects of a machine’s hardware profile change, then the license fulfillments become untrusted and the repair process is required to regenerate the license fulfillments based on the new hardware characteristics. Every 3rd party developer using ASR-based licensing must include license repair logic within their application. The repair option will need to be performed whenever the licenses become untrusted.

1) Repair sequence with ASR file on disk:

CoInitialize(NULL); IAuthorizeLicensePtr pAuth; pAuth.CreateInstance(CLSID_AoAuthorizeLicense); HRESULT hResult = pAuth->CheckASRFromFile((_T("<path_to_asr>"), _T("<password>")); if (hResult != S_OK) // If check fails, then repair

hResult = pAuth->RepairASRFromFile(_T("<path_to_asr>"),
_T("<password>"));
2) Repair sequence with ASR embedded, as a string, within the application:

CoInitialize(NULL); IAuthorizeLicensePtr pAuth; pAuth.CreateInstance(CLSID_AoAuthorizeLicense); HRESULT hResult = pAuth->CheckASR((_T("<asr_string>"), _T("<password>")); if (hResult != S_OK) // If check fails, then repair

hResult = pAuth->RepairASR(_T("<asr_string>"), _T("<password>"));
3) If desired, the instance of IAuthorizeLicense may also be used to check which features have been repaired.

BSTR featuresAdded; hResult = pAuth->get_FeaturesAdded(&featuresAdded);

Using an ASR with ArcGIS 10.0: The IAuthorizeLicense COM interface is not available with a standard ArcGIS 10.0 install. A supplemental DLL and an ArcGIS Engine or Desktop patch are required to obtain the ASR-related functionality.

The supplemental DLL is “AoAuthorizer.dll”, which must be installed and registered as part of the developer’s application. The AoAuthorizer dll should not be installed into any of the ArcGIS Engine or Desktop installation folders. When building an application that will make use of the ASR functionality, it is necessary to import the AoAuthorizer.dll as shown in the samples below.

For .NET applications, the “ESRI.ArcGIS.AoAuthorizer.dll” has been provided to contain the runtime metadata for the types defined within the AoAuthorizer.dll. This assembly DLL must be referenced when building the .NET application.

The needed ArcGIS Engine or Desktop patch is provided in the form of an MSP that must be applied to a 10.0 Final ArcGIS Engine or Desktop install. The patch is only needed with 10.0 Final. It will be included in 10.0 Service Pack 1.

Migration Warning: At the ArcGIS 10.1 release, the IAuthorizeLicense interface will be moved from AoAuthorizer.dll to the esriSystem.olb. Possible coding changes may be required during the upgrade of the OEM application.

Article ID:000011435

Software:
  • ArcMap

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic