Output log info

This commit is contained in:
Jack251970 2025-06-16 21:31:51 +08:00
parent be15b836fc
commit 9e24d2cb91

View file

@ -1,9 +1,12 @@
using Microsoft.Win32; using System;
using Microsoft.Win32;
namespace Flow.Launcher.Helper; namespace Flow.Launcher.Helper;
internal static class WindowsMediaPlayerHelper internal static class WindowsMediaPlayerHelper
{ {
private static readonly string ClassName = nameof(WindowsMediaPlayerHelper);
internal static bool IsWindowsMediaPlayerInstalled() internal static bool IsWindowsMediaPlayerInstalled()
{ {
try try
@ -11,8 +14,9 @@ internal static class WindowsMediaPlayerHelper
using var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\MediaPlayer"); using var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\MediaPlayer");
return key?.GetValue("Installation Directory") != null; return key?.GetValue("Installation Directory") != null;
} }
catch catch (Exception e)
{ {
App.API.LogException(ClassName, "Failed to check if Windows Media Player is installed", e);
return false; return false;
} }
} }