Removing multiple versions of a COM object from the registry

B

bg_ie

Hi,

I created a COM object using C# and I installed it with a batch that
looks something like this -

ECHO OFF
PATH = C:\WINNT\Microsoft.NET\Framework\v2.0.50727
set target=C:\mydll.dll
echo * Unregister %target% with v2.0.50727
regasm.exe /u %target%

// Delete mydll.dll and compy new dll to C:

echo * Register assmebly
regasm.exe /tlb /codebase /s C:\mydll.dll

echo * Register DCOM security
@%windir%\REGEDIT.EXE /S %sourceDir%\mydll.reg

The problem is that when I changed versions of the .net framework I
ended up adding two version of the Com object to the registry. I then
changed the version number of my Com object and now I have 3
versions...

I can completely remove the Com object from the registry by using
regedit, but the problem of having multiple versions now exists on
multiple computers.

I must also point out that my origional install batch file didn't
uninstall the com object as shown above. I had a seperate batch for
doing that, so perhaps that was also an issue in getting multiple
versions.

How can I easily remove all versions of my com object from the
registry in a convenient manner?

Thanks for your help,

Barry.
 
P

Patrick Steele

echo * Unregister %target% with v2.0.50727
regasm.exe /u %target%

// Delete mydll.dll and compy new dll to C:

echo * Register assmebly
regasm.exe /tlb /codebase /s C:\mydll.dll

echo * Register DCOM security
@%windir%\REGEDIT.EXE /S %sourceDir%\mydll.reg

If you use the /tlb switch when registering an assembly, you must also
use it when unregistering or else the type library will remain
registered (although the actual COM object -- prog ids and GUID's --
will be removed).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top