Flow.Launcher/Flow.Launcher/Helper/WindowsMediaPlayerHelper.cs
2025-06-16 21:31:51 +08:00

23 lines
651 B
C#

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