Question

I'm trying to register a library on COM using WiX installer, but it seems to be ignoring me.

What I've tried so far is:

  1. Used heat.exe to harvest all the info corresponding to the .dll.

  2. Created a fragment containing all the information that I harvested from heat.exe. I copied all the harvested information into a single component, to make things easier.

  3. I call the component using a ComponentRef that points to the component containing the related info for the dll to register.

  4. I used a custom action to register it to the COM:

<CustomAction Id="RegisterComLibrary" Directory="ComPublishDllFolder" ExeCommand="regsvr32.exe /s [ComPublishDllFolder]MyLibrary.dll />

  1. Insert the CustomAction in the InstallExecuteSequence:

    <InstallExecuteSequence> <Custom Action="RegisterComLibrary" After="InstallFinalize">NOT Installed</Custom> </InstallExecuteSequence>

But then, when I try to find the .dll in the COM using oleview or trying to use it with Visual Studio, I can't see it.

What I'm doing wrong?

NOTE: I'm getting the following message while trying to register it manually:

The module "MyComObject.dll" was loaded but the call to DllRegisterServer failed.

Ensure that "MyComObject.dll" is a valid DLL or OCX and try again.

Was it helpful?

Solution

Sorry, it was completely my fault. A misunderstanding of how .Net dlls published in COM work.

When I published my .Net compiled dll in COM and tried to use it in a .Net project, it launched a message saying that I can't use a COM library compiled in .Net, as it is a .Net library.

At first I thought it was a mistake, but actually, if I try to use the library in a C++ project (for example), it works fine.

The problem is that Visual Studio doesn't allow to consum COM libraries published in the same language that you built your project, apparently...

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