Troubleshooting DLL Registration

March 3, 2016 — Konstantin Korchakov

From time to time, installing a new version of custom GIS tools turns into a headache and battle with the installers. In most installation cases, custom code is deployed by the installer into a specific folder and then registered within COM. Once the installer registers the custom libraries the user is then able to utilize newly installed extensions and tools.

Unfortunately, the installer doesn’t always deliver customizations as expected. This can be the case even if the installer works perfectly on your development machine, no error messages popped up, and re-installating the custom code doesn’t fix the problems. If this is the case, it might be time to troubleshoot the DLL registration of your custom code.

Before we move straight into troubleshooting and making changes to our system, lets overview what a dll registration issue could look like and what could be the signs of a registration issue.

First, a direct indication that the GIS system is missing custom components is a warning “UNREGISTERED PROGRAM” in the place where custom component should be listed. An error message within the name of missing component could be an indication of missing custom components as well. These messages tell us that the installer didn’t do it job. Some more complicated and less obvious signs would be:

  • New version deployed, but expected changes are not present.
  • Old dll files stay in folder after uninstallating custom code.
  • Application won’t start and system event log is full of “ActiveX component can’t create object” errors.
How do we solve this? There are several places to look. First of all, close all ArcGIS and ArcFM applications on the current machine unless you know for sure that they don’t use the missing customizations – this must be a rule #1. Three places we can look are: 
1. Installer. We can check if installer does registration, you can skip this part if installer works on a different machine or you feel confident about your developer. If not – run installer from command prompt “msiexec -i installerName.msi /log “c:\temp\logfile.txt”, this will give you installation details log and you can check if any registration actions were made against the custom libraries.
2. Installation folder. Here we can check for any libraries that are left over from the previous install in case if the uninstaller has left something. If this is the case, I would strongly recommend unregistering the old libraries manually before deleting them.  (See RegX tool below) 
3. ArcGIS tool “Component Category Manager” to see if component is registered and loaded from the correct path. (Descriptions below)
Steps 1-3 will give us an understanding of what is going on with registration. These next steps are for manual cleaning when the installer does not work properly and manual registration makes no differences. We are going to delete registration manually:
4. Uninstall custom code with uninstaller.
5. Remove <yourDllName>.ecfg file from “C:\Program Files (x86)\Common Files\ArcFM Solution\Configuration\CATID” folder.
6. Open system Registry Editor. You’ll be looking for your program id, dll name and GUID in the next registry keys:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\<ProgID>
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\<GUID>
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\CLSID\<GUID>
HKEY_CLASSES_ROOT\<ProgID>
HKEY_CLASSES_ROOT\Wow6432Node\CLSID\<GUID>
Under the product version (10.2.1.1 in the picture above), you can verify your installation folder and dll name with value of the CodeBase key. If the previous steps for unregistering did not work, the whole key with the GUID in its name needs to be removed (“{0311FBCB-2C0C-305B-874B-C3A3ED0D814F}” key in the example above).
The keys with the name of the program ID needs to deleted too:
7. It is not a usual practice, but some installers do register library within GAC, so checking GAC folder could be helpful.
8. Install custom product and check registration
Tools:
RegX Tool
ArcFM provides regx.exe tool for component registration, you can find it in the “/ArcFM Solution/bin” folder. Using “regx.exe /u libraryName.dll” will unregister the dll or ‘’regx.exe /r /c libararyName.dll” will register the dll. Carefully read the output as the output shows the program ids of customizations which are included in the dll.
Component Category Manager
Categories.exe is located in the “ArcGIS/Desktop10.x/bin” folder and shows all registered components within GIS. Use search to find a component by its program id. If the component cannot be found then it is not registered properly within GIS. If you do find the component, check to see if the path of it matches with your installation folder. This will make sure that the registered customization is not pointed to another dll. If you unregister or register anything, you will need to restart tool in order to refresh the listing.
We would like to end with some tips on how to avoid future situations with dll registration:
1. Before installing or uninstalling a product, close any application and stop any services which use the product or uses/shares any libraries with it.
2. Before installing a new version, uninstall previous version from Control Panel, even if new installer just overrides libraries. Only the developer knows if the components have the same IDs.
3. Avoid having several installers provide the same library with the same set of tools. An example would be – two separate desktop clients (one for electric group, second for the water group) both have the same custom ArcMap button.

We Wrote the Book

The Indispensible Guide to ArcGIS Online

Download It for Free

Konstantin Korchakov

Senior Software Engineer

What do you think?

Leave a comment, and share your thoughts

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


This site uses Akismet to reduce spam. Learn how your comment data is processed.