mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-29 12:03:04 +00:00
Added log message for third-party AVs
This commit is contained in:
parent
c0f2491eae
commit
1f1811b9ac
3 changed files with 52 additions and 0 deletions
38
src/Ryujinx.Common/Utilities/AVUtils.cs
Normal file
38
src/Ryujinx.Common/Utilities/AVUtils.cs
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Management;
|
||||||
|
|
||||||
|
namespace Ryujinx.Common.Utilities
|
||||||
|
{
|
||||||
|
public static class AVUtils
|
||||||
|
{
|
||||||
|
public static string GetAVName()
|
||||||
|
{
|
||||||
|
if (!OperatingSystem.IsWindows())
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 displayName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (ManagementException)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,6 +4,7 @@ using Ryujinx.Common.Configuration;
|
||||||
using Ryujinx.Common.GraphicsDriver;
|
using Ryujinx.Common.GraphicsDriver;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.Common.SystemInterop;
|
using Ryujinx.Common.SystemInterop;
|
||||||
|
using Ryujinx.Common.Utilities;
|
||||||
using Ryujinx.Modules;
|
using Ryujinx.Modules;
|
||||||
using Ryujinx.SDL2.Common;
|
using Ryujinx.SDL2.Common;
|
||||||
using Ryujinx.UI;
|
using Ryujinx.UI;
|
||||||
|
@ -341,6 +342,12 @@ namespace Ryujinx
|
||||||
Logger.Notice.Print(LogClass.Application, $"Ryujinx Version: {Version}");
|
Logger.Notice.Print(LogClass.Application, $"Ryujinx Version: {Version}");
|
||||||
SystemInfo.Gather().Print();
|
SystemInfo.Gather().Print();
|
||||||
|
|
||||||
|
string avName = AVUtils.GetAVName();
|
||||||
|
if (avName != null)
|
||||||
|
{
|
||||||
|
Logger.Notice.Print(LogClass.Application, $"Detected AV: {avName}");
|
||||||
|
}
|
||||||
|
|
||||||
var enabledLogs = Logger.GetEnabledLevels();
|
var enabledLogs = Logger.GetEnabledLevels();
|
||||||
Logger.Notice.Print(LogClass.Application, $"Logs Enabled: {(enabledLogs.Count == 0 ? "<None>" : string.Join(", ", enabledLogs))}");
|
Logger.Notice.Print(LogClass.Application, $"Logs Enabled: {(enabledLogs.Count == 0 ? "<None>" : string.Join(", ", enabledLogs))}");
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ using Ryujinx.Common.Configuration;
|
||||||
using Ryujinx.Common.GraphicsDriver;
|
using Ryujinx.Common.GraphicsDriver;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.Common.SystemInterop;
|
using Ryujinx.Common.SystemInterop;
|
||||||
|
using Ryujinx.Common.Utilities;
|
||||||
using Ryujinx.Modules;
|
using Ryujinx.Modules;
|
||||||
using Ryujinx.SDL2.Common;
|
using Ryujinx.SDL2.Common;
|
||||||
using Ryujinx.UI.Common;
|
using Ryujinx.UI.Common;
|
||||||
|
@ -214,6 +215,12 @@ namespace Ryujinx.Ava
|
||||||
Logger.Notice.Print(LogClass.Application, $"Ryujinx Version: {Version}");
|
Logger.Notice.Print(LogClass.Application, $"Ryujinx Version: {Version}");
|
||||||
SystemInfo.Gather().Print();
|
SystemInfo.Gather().Print();
|
||||||
|
|
||||||
|
string avName = AVUtils.GetAVName();
|
||||||
|
if (avName != null)
|
||||||
|
{
|
||||||
|
Logger.Notice.Print(LogClass.Application, $"Detected AV: {avName}");
|
||||||
|
}
|
||||||
|
|
||||||
Logger.Notice.Print(LogClass.Application, $"Logs Enabled: {(Logger.GetEnabledLevels().Count == 0 ? "<None>" : string.Join(", ", Logger.GetEnabledLevels()))}");
|
Logger.Notice.Print(LogClass.Application, $"Logs Enabled: {(Logger.GetEnabledLevels().Count == 0 ? "<None>" : string.Join(", ", Logger.GetEnabledLevels()))}");
|
||||||
|
|
||||||
if (AppDataManager.Mode == AppDataManager.LaunchMode.Custom)
|
if (AppDataManager.Mode == AppDataManager.LaunchMode.Custom)
|
||||||
|
|
Loading…
Reference in a new issue