开发者

Unregistering COM dll with a C# Setup Project

I've been stuck on this one for a while. I'll try explain in the simplest terms and at the best of my knowledge. I will honour any help.

I've got a C# project which uses a VB6 compiled ActiveX DLL that I'm constantly updating. I compile the setup project, send it to the client and they run the setup. When building the updated setup开发者_StackOverflow中文版 project, I would increase the 'Version' of the setup project so it wouldn't bother with 'Another version is already installed'.

What started happening after a few updates I began to notice the DLL would not be updated to the new version in the installer. The client computer had the original DLL both installed and registered. First symptom: method not found exceptions from the client C# code.

This is not a shared DLL and only this application needs it.

I've noticed that when uninstalling the application (through the usual procedure) the DLL is also not removed from the application folder although I would set this file's property 'Permanent' to false. The registration entries in the registry are mantained also.

I do update in VS6.0 the version of the DLL (usually increase the build number) before building it. Then in VS2008, I remove it from the References, and add it again from the 'Browse tab', without re-registering it on my dev machine and adding it from the COM tab.

I've thought of these options.

  • Custom step in Setup project to regsvr32.exe /u 'hardcoded path of my dll' at uninstall (ugly)
  • Somehow find out how the 'Isolate' property can work for me without registering
  • Find out how to execute setup project 'Conditions' that would actually check the version of the library and to update the file accordingly at every install)

Any help would be incredibly welcome.


Out of curiosity? Why not try using WiX? http://wixtoolset.org/

It's great for building installers and you can do this stuff as easily as :

<File Id="guifreak3" Name="Guifreaks.NavigationBar.XmlSerializers.dll" Source="$(var.Plex.MobileHub.Client.Interface.TargetDir)Guifreaks.NavigationBar.XmlSerializers.dll"/>

Wix will automatically remove the dll when it is uninstalled.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜