unregister DLL and clean COM entries - ArcGIS Desktop customisations

6032
9
07-06-2010 08:01 PM
New Contributor III
Hi there, we're upgrading VB6 custom application to .NET. Any ideas on automatically unregistering the VB6 DLL and removing ArcGIS Desktop categories entries (commands, toolbars etc) using code?

For ArcGIS 10, am assuming there's no categories ... but for ArcGIS 9.3.1 users we still need to run this. Any suggestions is much appreciated.

Thanks.
Reply
0 Kudos
9 Replies
New Contributor
From command line:

regsvr32 /u myvb6dll.dll
Reply
0 Kudos
New Contributor III
Thanks for the prompt reply ...

Does it remove all entries in component category (i.e. ESRI Mx Commands) and CLSID automatically? I don't think the registry entry in HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID and HKEY_LOCAL_MACHINE\SOFTWARE\Classes for the custom DLLs gets cleaned up.
Reply
0 Kudos
New Contributor
Should be OK because Implemented Categories are under CLSID so by removing CLSID you should get rid of them too:

HKEY_CLASSES_ROOT\CLSID\{clsid-guid}\Implemented Categories\{category-guid}
Reply
0 Kudos
New Contributor
I think unregistering the DLLs will still leave entries in the categories, so you'll still have some work to do to clean everything up.  I've had a quick look before on how to do this programmatically but never managed to work it out so always ended up doing it manually.
Reply
0 Kudos
New Contributor
Not so nice then...

Since guids do not change and number of component CLSIDs do not grow often, a simple semiautomatic approach would be to prepare .reg file to delete registry entries using regedit (by double-clicking reg file), see http://support.microsoft.com/kb/310516

[-HKEY_CLASSES_ROOT\CLSID\{clsid-guid}]
[-HKEY_CLASSES_ROOT\{name}]
[-HKEY_CLASSES_ROOT\{name.version}]
Reply
0 Kudos
New Contributor
To delete from the registry would seem to be the only way to do it if you've got a large number of machines.  Shame there doesn't seem to be any inbuilt support for doing this.  It's all too easy to get things into categories, but if you're not careful you can easily end up with a lot of garbage in there.
Reply
0 Kudos
Regular Contributor III
It was typical in VB6 to use the Package and Deployment Wizard to create installers for ArcGIS customizations.  ESRI had a VS addin that would create a *.reg file that you could use to register all of your classes.  To unregister all of the classes you would create a copy of this file and modify it to unregister (put a minus in front of all of the registry keys).  After you create the installer for your new .NET version of the application, just have it merge this "unregister" file into the registry.
Reply
0 Kudos
New Contributor III
thanks everyone ... I wrote a function to unregister, cleanup registry and remove files for COM based ArcObjects DLL. Cheers.
Reply
0 Kudos
New Contributor
Hi,
  I am looking for the same automation which will clean up the registry for Arcobjects dlls. Could you please share the function?


Thanks,
Nikhil
Reply
0 Kudos