Allowing the Windows Installer to manage registry keys is much preferable to executing registration code, such as regsvr32.exe or regasm.exe, during installation. To that end, Advanced Harvesting can extract the registration out of harvested files. This includes:
DllRegisterServer
-RegServer
switchTo enable self-registration harvesting add the SelfReg="true"
attribute to the harvest directive. For example,
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
xmlns:fg="http://www.firegiant.com/schemas/v4/wxs/heatwave/buildtools">
<Fragment>
<ComponentGroup Id="ConsoleAppComponents">
<Component Directory="INSTALLFOLDER">
<fg:HarvestProjectOutput Name="ConsoleApplication1"
OutputGroups="BuiltProjectOutputGroup"
SelfReg="yes" />
</Component>
<Component Directory="INSTALLFOLDER">
<fg:HarvestFile Source="!(bindpath.Foo)\path\to\foo.dll"
SelfReg="yes" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
The harvested registry keys are included in the Component with the self-registered file.