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://schemas.microsoft.com/wix/2006/wi"
xmlns:fg="http://www.firegiant.com/schemas/v3/wxs/fgwep.xsd">
<Fragment>
<ComponentGroup Id="ConsoleAppComponents">
<Component Directory="INSTALLFOLDER">
<fg:HarvestProject Name="ConsoleApplication1"
OutputGroup="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.