Write to InstallLog from Installer
How do I write to the InstallLog from a service installer?
I've overridden the OnBeforeInstall
method of my class (which derives from System.Configuration.Install.Installer
and now I want to write to the installer log. But I can't see anything that would allow me to do this.
Console.WriteLine will wr开发者_运维百科ite to the console but not to the log.
As far as I can see, there's a property called Context in the Installer class. It has type InstallContext. That type has the method LogMessage(), which I suppose is what you need. See this article for more information about LogMessage() method.
精彩评论