mirror of
https://github.com/Readarr/Readarr
synced 2025-12-26 18:22:32 +01:00
Use Environment.ProcessPath instead of GetCurrentProcess().MainModule.FileName
GetCurrentProcess().MainModule.FileName is expensive, Environment.ProcessPath added in net6 (cherry picked from commit f928ee7cad304115a002da00e218fb987e02b279) Close #2260
This commit is contained in:
parent
55308bef8b
commit
f26fd39709
2 changed files with 4 additions and 2 deletions
|
|
@ -65,7 +65,7 @@ public virtual void Install(string serviceName)
|
|||
|
||||
var args = $"create {serviceName} " +
|
||||
$"DisplayName= \"{serviceName}\" " +
|
||||
$"binpath= \"{Process.GetCurrentProcess().MainModule.FileName}\" " +
|
||||
$"binpath= \"{Environment.ProcessPath}\" " +
|
||||
"start= auto " +
|
||||
"depend= EventLog/Tcpip/http " +
|
||||
"obj= \"NT AUTHORITY\\LocalService\"";
|
||||
|
|
|
|||
|
|
@ -47,7 +47,9 @@ public static void Start(string[] args, Action<IHostBuilder> trayCallback = null
|
|||
{
|
||||
try
|
||||
{
|
||||
Logger.Info("Starting Readarr - {0} - Version {1}", Assembly.GetCallingAssembly().Location, Assembly.GetExecutingAssembly().GetName().Version);
|
||||
Logger.Info("Starting Readarr - {0} - Version {1}",
|
||||
Environment.ProcessPath,
|
||||
Assembly.GetExecutingAssembly().GetName().Version);
|
||||
|
||||
var startupContext = new StartupContext(args);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue