Writing to InstallLog from the installer

How to write to InstallLog from a service installer?

I redefined the method of OnBeforeInstallmy class (which comes from System.Configuration.Install.Installerand now I want to write to the installer log. But I do not see anything that would allow me to do this.

Console.WriteLine will write to the console, but not to the log.

+3
source share
1 answer

As far as I can see, there is a Context property in the Installer class. It has type InstallContext. This type has a LogMessage () method, which I suppose is what you need. See this article for more information on the LogMessage () method.

+2
source

Source: https://habr.com/ru/post/1791184/


All Articles