Register com dll on wix

If you do not register yourself. then how do we register COM dll during installation using WIX?

According to the tutorial, I used the ComPlusApplication example (non.net dll). But that does not work. He is not registered.

I can successfully register regsvr32 from the command line. I read that you are not creating custom actions to register com dll.

And what's the best approach? If we need to use heat, where do we write the commands and add the wxs result to the main project?

+8
com wix wix3 heat
source share
2 answers

I highly recommend using the Wix Heat.exe tool to collect all the data needed to register the lump, and then link to the fragment in the .wxs file as follows:

<ComponentGroupRef Id="FooBar.dll" /> 

Or include it in your .wxs file as follows:

  <?include FooBar.dll.wxi?> 

This method gives you complete control over what happens during the registration / unregistration of the Com component.

However, you can use Regsvr32 in a Wix project. But it relies on the correct implementation of the RegisterServer / UnregisterServer functions in the COM component

  <CustomAction Id="RegisterFooBar" Directory="INSTALLDIR" ExeCommand='regsvr32.exe /s "[INSTALLDIR]FooBar.dll"'> </CustomAction> <CustomAction Id="UnregisterFooBar" Directory="INSTALLDIR" ExeCommand='regsvr32.exe /s /u "[INSTALLDIR]FooBar.dll"'> </CustomAction> 

Then add your action to the installation sequence.

  <InstallExecuteSequence> <Custom Action="RegisterFooBar" After="InstallFinalize">NOT Installed</Custom> <Custom Action="UnregisterFooBar" After="InstallFinalize">REMOVE="ALL"</Custom> </InstallExecuteSequence> 
+17
source share

You can try using the heat.exe program and then reference the snippet in the wix code.

heat.exe -gg -out file

How in:

file heat.exe my.dll -gg -out my.wxs

Ps. Adding -gg will generate hints, otherwise you can skip it if you want to manually add them.

+2
source share

All Articles