Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Custom log messages to MSI log file


3 replies to this topic

uljo2

uljo2
  • Full Members
  • 7 posts

Posted 29 September 2008 - 14:00

Hi,

If I want to debug some change I made in the script I can always put a "Display Message" box in the script to look at some variable etc.

But is there a standard msi command that I can put in the script that logs a text to logfile produced at installation? In that way it can always be enabled.

I have a custom action, that can be used for this. But maybe there is a more standard approach that I missed.

BR Ulf


VBScab

VBScab
  • Full Members
  • 436 posts

Posted 29 September 2008 - 14:22

You can use the MSI log itself for this. Google for 'Session.Message'.
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

uljo2

uljo2
  • Full Members
  • 7 posts

Posted 29 September 2008 - 15:23

QUOTE (VBScab @ 2008-09-29 14:22)
You can use the MSI log itself for this. Google for 'Session.Message'.

Thanks, I found it. Google is good but you must search with the right words.


I used some "Call VBScript from embedded code" in my installer tool using this code snippet.

Dim recordLogText
Set recordLogText = Session.Installer.CreateRecord(1)
recordLogText.StringData(1) = "Runnig this custom action"
Session.Message &H04000000, recordLogText


Ok I thought there an even easier solution, but this one will do. It's better than using my ca.dll, passing msi handle and stuff.

/Ulf

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 29 September 2008 - 15:32

QUOTE (uljo2 @ 2008-09-29 14:23)
QUOTE
Ok I thought there an even easier solution <snip>

There sort of is. I have this wrapped up in a class, which I append to any script which needs it. Then I just instantiate an object for that class (let's call it 'clsMSILog') and then just do 'clsMSILog.LogEntry = "some text or other" '

No need to remember constant values, syntax, nothing...
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.