It is atypical use-case for Wix# thus there is no native solution for this but you can achieve it quite easily with either XML-Includes or XML-Injection.
While the functionality has been available for quite sometime the latest code base contains dedicated Embedding_CA_Package sample demonstrating both techniques.
XML-Includes approach for embedding myaction.CA.dll package:
where myaction.wxi contains:
While the functionality has been available for quite sometime the latest code base contains dedicated Embedding_CA_Package sample demonstrating both techniques.
XML-Includes approach for embedding myaction.CA.dll package:
var project = new Project("CustomActionTest", new Binary(new Id("MyAction_File"), "myaction.CA.dll")); project.AddXmlInclude("myaction.wxi"); project.BuildMsi();
<Include><CustomActionId="MyAction"BinaryKey="MyAction_File"DllEntry="MyAction"Impersonate="yes"Execute="immediate"Return="check"/><InstallExecuteSequence><CustomAction="MyAction"After="InstallInitialize">(NOT Installed)</Custom></InstallExecuteSequence></Include>