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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s