Ensure event source is registered during installation

pull/515/head
NextTurn 2019-11-13 00:00:00 +08:00
parent ea6cb8062a
commit 639beadb36
No known key found for this signature in database
GPG Key ID: 17A0D50ADDE1A0C4
1 changed files with 6 additions and 0 deletions

View File

@ -728,6 +728,12 @@ namespace winsw
rawSecurityDescriptor.GetBinaryForm(securityDescriptorBytes, 0);
_ = Advapi32.SetServiceObjectSecurity(sc.Handle, SecurityInfos.DiscretionaryAcl, securityDescriptorBytes);
}
string eventLogSource = descriptor.Id;
if (!EventLog.SourceExists(eventLogSource))
{
EventLog.CreateEventSource(eventLogSource, "Application");
}
}
void Uninstall()