Open kipamgs opened 1 month ago
Unfortunately, MSI does not provide any interface for that.
When WixSharp ManagedUI is used it intercepts all messages from the progress dialog and always redirects all log messages to the log file. This is exactly the behaviour you want. But it's only available if you use ManagedUI. There is no other way.
I use the ManagedUI but session.Log messages are only written to the log file if i start the installer with /lv installer.log
arguments.
Yes but not exactly.
If you did not start your msi with /lv
you can still click the "view log" button in the exit dialog and see the log file:
I tried that but the messages that i write via session.Log are not displayed in this log file. I think it is not written without /lv
.
WixSharp-wix.WPF version 2.4.1 .
OK, you are right.
I checked the code and indeed the native MSI log is unavailable. Even from ManagedUI. It is a limitation of MSI API. Apologies for misleading you.
What I do in ManagedUI is intercept the progress messages and runtime exceptions and log them in the memory. When the user clicks "View Log" I simply display this custom log in the system's default text viewer. This is a poor man substitution for the MSI log.
But what it means is that You can still do so
Thanks. Is there an example available? Or do you just use a property/static variable to store the log?
When using session.Log("Some logging message") it is only written to the log file when the installer is started with /LV arguments. Is it possible to enable writing to the logfile always?