WIX: COM registration when uninstalling one of two programs

I am relatively new to WiX. This is a great tool, but I still need some time to find out better. I encountered a problem registering and unregistering a COM component. I created installers for two applications, called them A and B. Both use the same COM component. I used a heat tool as recommended. When installing A or B, the component is registered without any problems.

But when I install A and B, delete A (using Add / Remove programs) the COM class becomes unregistered, and B can no longer use it. Is there a clean solution to prevent this? I would like to unregister COM when BOTH A and B are deleted.

Any help would be appreciated

Regards, madbadger

EDIT: Thanks for your answers. I set the GUID to the same value in both installers, and now the registry keys are deleted properly, that is, when the last program is removed from the system.
Hovewer, the problem persists for one reason. I checked the registry under HKEY_CLASSES_ROOT / CLSID / [corresponding COM GUID]. Here's what happens:
- I install A, and the path to COM is set to [the path to A / component.dll]
- I install B, and the path to COM is set to [the path to B / component.dll]
- I delete B, and path to COM remains [path to B / component.dll]
- Now A cannot access the COM component because it is registered because [path to B / component.dll] no longer exists

, COM- . Windows , - ?

+5
3

Windows , COM- GUID A, B ( DLL .)

Windows - ( ). GUID.

COM- GUID, :

  • A: refcount 0- > 1, Windows
  • B: refcount 1- > 2,
  • A: refcount 2- > 1,
  • B: 1- > 0, Windows

GUID, ,

  • A: . 0- > 1, Windows .
  • B: B refcount 0- > 1, Windows , A.
  • A: . 1- > 0, Windows , .
    - , , .
  • B: B refcount 1- > 0, Windows , ( ).

:

GUID, "Key Path". , , "" , KeyPath="foo.dll". , .

, - , Windows GUID, -, ( , , ), , 2 GUID, , .

, . , , System32 .

- ( Program Files\Common Files\YourCompanyName). Wix : Directory="[CommonFilesFolder]\YourCompanyName"

+4

Component Guid ?

+1

You must wrap this common component in a merge module and point it out from both applications.

This will automatically allow the reassembly of common dlls to do its work on deletion.

0
source

All Articles