开发者

Write to InstallLog from Installer

开发者 https://www.devze.com 2023-02-10 04:48 出处:网络
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.Installerand now I want to write to

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.Installerand 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消