Hi,
In a VBScript Custom Action, you can simply use the
WriteToLog function described in
this HowTo article:
Code: Select all
Function WriteToLog(msg)
Const msiMessageTypeInfo = &H04000000
Set record = Session.Installer.CreateRecord(1)
record.StringData(0) = "[1]"
record.StringData(1) = CStr(msg)
Session.Message msiMessageTypeInfo, record
End Function
You can invoke it from your code as follows:
Code: Select all
Function YourCAFunction
WriteToLog("[MY_CA] Message for log.")
End Function
Keep in mind however that your Custom Action must be scheduled in one of sequence tables (InstallUISequence and/or InstallExecuteSequence) - logging will not work from an UI Custom Action.
In a C++ DLL Custom Action use the
MsiProcessMessage function.
Regards,
Ionut