How to write to MSI log properly? - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

How to write to MSI log properly?

Hello everyone.

I am trying to shift away from my own custom logging (which seems to fail with deferred custom actions) to logging into the MSI log.

The problem is that whatever MsiMessageType I specify, and whatever logging parameters I specify in the bootstrapper (last I tried "/learwp+ install.log") the message gets logged - but also a popup shows up with the log message. I would like to just log, not log and show a popup message. Is that possible?

This is the code that I am using to log to the MSI log file:

Code: Select all

var msiMessageTypeWarning    = 0x02000000;
var rec           = Session.Installer.CreateRecord(1);
rec.StringData(0) = "[1]";
rec.StringData(1) = msg;
Session.Message(msiMessageTypeWarning, rec);


(A problem possibly related is that I tried "/l* ...", but that dramatically increased the time that the installer required to run through, so I would like to stick to a smaller set of items being logged (like /lear, etc.).)



With best regards

Clemens Anhuth
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: How to write to MSI log properly?

Hello everyone.

I tried using the MsiTpyeInfoUser type and using the bootstrapper parameters "/learip+ install.log", using this code:

Code: Select all

var msiMessageTypeInfo       = 0x04000000;
var rec           = Session.Installer.CreateRecord(1);
rec.StringData(0) = "[1]";
rec.StringData(1) = msg;
Session.Message(msiMessageTypeInfo, rec);
This works, it logs to the log file and does not show any popup.



With best regards

Clemens Anhuth

Return to “Common Problems”