Question

I use heat util from the WIX toolset to generate COM registration of a dll. All works fine until there is only one product using that dll.

But when this dll was already registered by another product or is used by later-installed products, uninstalling of my product removes DLL registration and breaks other applications.

Is there a way to overcome this issue? I have an idea to make generated component permanent, but looks like there is no simple way to accomplish it. And it is not ideal situation because it would be better to remove DLL registration if our application is the opny one who use that dll.

The other issue is registering dll changes the previous registration even if it has newer version. Again it will break other applications. We would like to use never version if it is already installed.

Can anybody recommend a simple solution to overcome described issues?

Was it helpful?

Solution

When adding a shared DLL you should encapsulate the DLL in a component with the same ID in both products. The component will be installed when it is not already installed. It will be removed when the last product that uses it is uninstalled. Use a WiX library to handle the shared component.

You will have to find a install location for that shared DLL. When you uninstall product A you will expect that the install folder of the product is removed and the same appears for product B. Therefore the shared DLL should be in the Common Files tree.

Since the COM registration has always an absolute path to the COM server DLL, it is always bound to the DLL in the appropriate product. If the product installers don't share the knowledge about the shared DLL your product should avoid sharing the DLL. You can use Registration Free COM to achieve this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top