user626528
user626528

Reputation: 14418

How to write custom messages to MSI log?

I need to write a custom message to MSI log from my MSI package. How to do this?

Upvotes: 2

Views: 1293

Answers (1)

Bogdan Mitrache
Bogdan Mitrache

Reputation: 11013

For this you can create a custom action, Win32 DLL recommended. Unfortunately I have only a VBS sample for you, which you can use as a starting point but don't recommend for use in your official release of the package:

Function WriteToLog(TextToWrite)
  Const MsgType = &H04000000
  Set rec = Installer.CreateRecord(1)
  rec.StringData(1) = TextToWrite
  Session.Message MsgType, rec
  'Msgbox TextToWrite
WriteToLog = 0
End Function

Upvotes: 4

Related Questions