Fix executable path on .NET Core

pull/389/head
NextTurn 2020-01-30 00:00:00 +08:00
parent 9e830f9e88
commit 189e3d52e2
No known key found for this signature in database
GPG Key ID: 17A0D50ADDE1A0C4
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;