mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Use Environment.ProcessPath over calculating it ourselves
It's still required to be a static readonly field, as we need it calculated in-advance due to renames/deletion of original binary. Also I'll probably need madness for this, sigh.
This commit is contained in:
@@ -39,7 +39,7 @@ namespace ArchiSteamFarm.Core;
|
||||
|
||||
internal static class OS {
|
||||
// We need to keep this one assigned and not calculated on-demand
|
||||
internal static readonly string ProcessFileName = Process.GetCurrentProcess().MainModule?.FileName ?? throw new InvalidOperationException(nameof(ProcessFileName));
|
||||
internal static readonly string ProcessFileName = Environment.ProcessPath ?? throw new InvalidOperationException(nameof(ProcessFileName));
|
||||
|
||||
internal static DateTime ProcessStartTime {
|
||||
#if NETFRAMEWORK
|
||||
|
||||
Reference in New Issue
Block a user