From 9b2ccd2943de1fb4e6b7f833524c08864d3f43fd Mon Sep 17 00:00:00 2001 From: Adam Thorn <alt36@cam.ac.uk> Date: Wed, 10 Jun 2020 16:10:07 +0100 Subject: [PATCH] Add eventLog to WpkgInstaller service --- WpkgInstaller/WpkgInstaller.Designer.cs | 10 ++++++++++ WpkgInstaller/WpkgInstaller.cs | 5 +++++ WpkgInstaller/WpkgInstaller.resx | 3 +++ 3 files changed, 18 insertions(+) diff --git a/WpkgInstaller/WpkgInstaller.Designer.cs b/WpkgInstaller/WpkgInstaller.Designer.cs index 0e35654..3cc47e6 100755 --- a/WpkgInstaller/WpkgInstaller.Designer.cs +++ b/WpkgInstaller/WpkgInstaller.Designer.cs @@ -28,13 +28,23 @@ /// </summary> private void InitializeComponent() { + this.eventLog = new System.Diagnostics.EventLog(); + ((System.ComponentModel.ISupportInitialize)(this.eventLog)).BeginInit(); + // + // eventLog + // + this.eventLog.MachineName = ".eventLog"; + this.eventLog.EntryWritten += new System.Diagnostics.EntryWrittenEventHandler(this.eventLog_EntryWritten); // // WpkgInstaller // this.ServiceName = "Service1"; + ((System.ComponentModel.ISupportInitialize)(this.eventLog)).EndInit(); } #endregion + + private System.Diagnostics.EventLog eventLog; } } diff --git a/WpkgInstaller/WpkgInstaller.cs b/WpkgInstaller/WpkgInstaller.cs index 4f430b2..d58fa9b 100755 --- a/WpkgInstaller/WpkgInstaller.cs +++ b/WpkgInstaller/WpkgInstaller.cs @@ -56,5 +56,10 @@ namespace WpkgInstaller serviceStatus.dwCurrentState = ServiceState.SERVICE_STOPPED; SetServiceStatus(this.ServiceHandle, ref serviceStatus); } + + private void eventLog_EntryWritten(object sender, System.Diagnostics.EntryWrittenEventArgs e) + { + + } } } diff --git a/WpkgInstaller/WpkgInstaller.resx b/WpkgInstaller/WpkgInstaller.resx index 34987b2..a1934c4 100755 --- a/WpkgInstaller/WpkgInstaller.resx +++ b/WpkgInstaller/WpkgInstaller.resx @@ -117,6 +117,9 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> + <metadata name="eventLog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> <metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> </metadata> -- GitLab