From 4ae4dd0fd15a4599be785e3ba5baef7865ce7446 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:22:03 +0100 Subject: [PATCH] [Backport] #243 to rel/2.2.x (#244) Hotfix for bot file properties being not found on linux Co-authored-by: Sella-GH <147769367+Sella-GH@users.noreply.github.com> --- src/AzzyBot.Core/Utilities/SoftwareStats.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/AzzyBot.Core/Utilities/SoftwareStats.cs b/src/AzzyBot.Core/Utilities/SoftwareStats.cs index df7d5921..8a1bf41f 100644 --- a/src/AzzyBot.Core/Utilities/SoftwareStats.cs +++ b/src/AzzyBot.Core/Utilities/SoftwareStats.cs @@ -38,9 +38,9 @@ public static DateTimeOffset GetAppUptime() private static string GetAppFilePath() { - using Process app = Process.GetCurrentProcess(); - - string? fileName = app.MainModule?.FileName; + string fileName = Path.Combine(AppContext.BaseDirectory, AppDomain.CurrentDomain.FriendlyName); + if (!HardwareStats.CheckIfLinuxOs) + fileName += ".exe"; return (!string.IsNullOrEmpty(fileName)) ? Path.Combine(AppContext.BaseDirectory, fileName)