Inspecting Wix Managed Custom Actions

logo-black-hollow-xs

Wix Toolset allows creating .net managed Custom actions for the Windows Installers. Windows Installer only supports

Custom Actions in .exe, VBScript, JScript and .dll

The tool which marshals std call to native dll function into managed code is called Deployment Tools Foundation (DTF).

image

When you open an Msi with managed CA in Orca, you will see it as a native .dll in Binary table. You can also notice WixCA binary attachment named after your binary , which basically encapsulates all DTF code which extracts managed CA.

For example your binary in a .wxs file:

<Binary Id=”CustomActionBinary” SourceFile=”$(var.CA.TargetDir)$(var.CA.TargetName).CA.dll”/>

If you export your binary as .dll and open it in Dependency Walker you will see your Custom Action name as exported function in .dll

image

The CA binary is actually created by MakeSfxCA, which is actually attaching all CA managed binaries and WixCA in a .dll as Windows Cab file.

For example 7Zip can extract cabinet files to actual content:

image

And here is how it looks in ILSpy

image