mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add try catch for register key check
This commit is contained in:
parent
43c74f04ac
commit
30d10bb37f
1 changed files with 10 additions and 2 deletions
|
|
@ -1,11 +1,19 @@
|
|||
using Microsoft.Win32;
|
||||
|
||||
namespace Flow.Launcher.Helper;
|
||||
|
||||
internal static class WindowsMediaPlayerHelper
|
||||
{
|
||||
internal static bool IsWindowsMediaPlayerInstalled()
|
||||
{
|
||||
using var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\MediaPlayer");
|
||||
return key?.GetValue("Installation Directory") != null;
|
||||
try
|
||||
{
|
||||
using var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\MediaPlayer");
|
||||
return key?.GetValue("Installation Directory") != null;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue