unregister DLL and clean COM entries - ArcGIS Desktop customisations

11287
9
07-06-2010 08:01 PM
tonydavid
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.
0 Kudos
9 Replies
RemigijusPankevicius
New Contributor
From command line:

regsvr32 /u myvb6dll.dll
0 Kudos
tonydavid
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.
0 Kudos
RemigijusPankevicius
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}
0 Kudos
AndrewMay
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.
0 Kudos
RemigijusPankevicius
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}]
0 Kudos
AndrewMay
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.
0 Kudos
NeilClemmons
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.
0 Kudos
tonydavid
New Contributor III
thanks everyone ... I wrote a function to unregister, cleanup registry and remove files for COM based ArcObjects DLL. Cheers.
0 Kudos
nikhilsastikar
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
0 Kudos