This commit is contained in:
SamusAranX 2024-06-27 21:28:23 +00:00 committed by GitHub
commit a7a4c815be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 50 additions and 0 deletions

View file

@ -0,0 +1,38 @@
using System;
using System.Linq;
using System.Management;
namespace Ryujinx.Common.Utilities
{
public static class AVUtils
{
public static bool IsRunningThirdPartyAV()
{
if (!OperatingSystem.IsWindows())
{
return false;
}
ManagementObjectSearcher wmiData = new ManagementObjectSearcher(@"root\SecurityCenter2", "SELECT * FROM AntiVirusProduct");
ManagementObjectCollection data = wmiData.Get();
foreach (ManagementObject dataObj in data.Cast<ManagementObject>())
{
try
{
string displayName = (string)dataObj["displayName"];
if (displayName != "Windows Defender")
{
return true;
}
}
catch (ManagementException)
{
continue;
}
}
return false;
}
}
}

View file

@ -4,6 +4,7 @@ using Ryujinx.Common.Configuration;
using Ryujinx.Common.GraphicsDriver;
using Ryujinx.Common.Logging;
using Ryujinx.Common.SystemInterop;
using Ryujinx.Common.Utilities;
using Ryujinx.Modules;
using Ryujinx.SDL2.Common;
using Ryujinx.UI;
@ -341,6 +342,11 @@ namespace Ryujinx
Logger.Notice.Print(LogClass.Application, $"Ryujinx Version: {Version}");
SystemInfo.Gather().Print();
if (AVUtils.IsRunningThirdPartyAV())
{
Logger.Notice.Print(LogClass.Application, $"Third-Party AV active");
}
var enabledLogs = Logger.GetEnabledLevels();
Logger.Notice.Print(LogClass.Application, $"Logs Enabled: {(enabledLogs.Count == 0 ? "<None>" : string.Join(", ", enabledLogs))}");

View file

@ -7,6 +7,7 @@ using Ryujinx.Common.Configuration;
using Ryujinx.Common.GraphicsDriver;
using Ryujinx.Common.Logging;
using Ryujinx.Common.SystemInterop;
using Ryujinx.Common.Utilities;
using Ryujinx.Modules;
using Ryujinx.SDL2.Common;
using Ryujinx.UI.Common;
@ -214,6 +215,11 @@ namespace Ryujinx.Ava
Logger.Notice.Print(LogClass.Application, $"Ryujinx Version: {Version}");
SystemInfo.Gather().Print();
if (AVUtils.IsRunningThirdPartyAV())
{
Logger.Notice.Print(LogClass.Application, $"Third-Party AV active");
}
Logger.Notice.Print(LogClass.Application, $"Logs Enabled: {(Logger.GetEnabledLevels().Count == 0 ? "<None>" : string.Join(", ", Logger.GetEnabledLevels()))}");
if (AppDataManager.Mode == AppDataManager.LaunchMode.Custom)