Reputation: 1309
I am writing a WiX installer with some custom action.
I read here that Session.Log
in a C# Custom Action doesn't work if the action is run as a result of a button click (DoAction).
MSDN says that you can use the Message Method, so I tried with Session.Message:
var foo = new Record(1);
foo.SetString(0, "hello world");
session.Message(InstallMessage.ActionData, foo);
but I still can't see the log message even when using VERBOSE=1. The installer is created with WiX Burn so there isn't a separated msi.
Any help please?
Upvotes: 0
Views: 1462
Reputation: 55600
Generally, this is a known issue with the underlying Windows Installer:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa368322(v=vs.85).aspx
It seems that after Server 2003 the Message method may work but honestly I stopped using script custom actions years ago so it's not an option for me. I use C#/DTF which uses MsiProcessMessage.
The usual workaround for this is to take advantage of the fact that property changes get logged. Just set an unused property a bunch of times and you have your data in the log.
Upvotes: 2