Merge pull request #515 from NextTurn/eventlog

Ensure event source is registered during installation
pull/457/head^2
Oleg Nenashev 2020-04-18 14:32:30 +02:00 committed by GitHub
commit a1d335bd60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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()