View Full Version : Logging from inside Managed Custom Actions.

10-31-2013, 09:35 AM

I'm trying to add logging to my managed (C#) custom actions.

The log reports that the custom action is called. But nothing is logged from inside the managed code.

I created a small function to illustrate...

public void TestLogging(int handle, string msg)
using (Msi.Install install = Msi.CustomActionHandle(handle))
Msi.Record record = new Msi.Record(1);

//record.SetString(0, msg);
record.SetString(0, "Hello World...!");;

install.ProcessMessage(Msi.InstallMessage.Info, record);

A snippet from the log is shown below.

MSI (c) (98:B0) [14:26:38:656]: Doing action: TestLogging
Action 14:26:38: TestLogging.
Action start 14:26:38: TestLogging.
MSI (c) (98:1C) [14:26:38:665]: Invoking remote custom action. DLL: C:\Users\JASON~1.HAU\AppData\Local\Temp\MSIC2E4.tmp, Entrypoint: m2
Action ended 14:26:39: TestLogging. Return value 1.

Any ideas why my message does not appear?

11-01-2013, 07:44 AM
I guess this is not possible. See


Odd how the methods are exposed, but unusable.... :confused:

11-01-2013, 11:19 AM
Unless I'm missing something, Managed actions don't fit well with Installshield.:mad:

The suggested work-around, changing a property in the managed custom action in order for the change in value to be logged, does not work for me.....

What am I doing wrong?????

11-04-2013, 11:25 AM
How are you generating your log - namely are you specifying v of /l*v (or of voicewarmup, depending on context)? I believe only verbose logs contain property change information.

Christopher Painter
11-04-2013, 10:17 PM
Logging from managed c# custom actions is easy:

session.Log("Hello World");

You just have to be using the right tools. The tool I'm thinking of is completely compatible with Windows Installer and therefore InstallShield. I don't care who made the tool.... I only care about efficiently making bulletproof installers.