Merge pull request #389 from NextTurn/exepath

Fix executable path and XML config file resolution on .NET Core
pull/393/head
Oleg Nenashev 2020-01-30 11:10:10 +01:00 committed by GitHub
commit 5c3865f684
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -19,9 +19,7 @@ namespace winsw.Configuration
public string Executable => throw new InvalidOperationException(nameof(Executable) + " must be specified.");
public bool HideWindow => false;
// this returns the executable name as given by the calling process, so
// it needs to be absolutized.
public string ExecutablePath => Path.GetFullPath(Environment.GetCommandLineArgs()[0]);
public string ExecutablePath => Process.GetCurrentProcess().MainModule.FileName;
// Installation
public bool AllowServiceAcountLogonRight => false;