mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-13 11:09:06 +00:00
Detect all WebView2 version using the provided API
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Web.WebView2.Core;
|
||||||
|
|
||||||
namespace QuickLook.Plugin.HtmlViewer
|
namespace QuickLook.Plugin.HtmlViewer
|
||||||
{
|
{
|
||||||
@@ -26,14 +26,13 @@ namespace QuickLook.Plugin.HtmlViewer
|
|||||||
{
|
{
|
||||||
public static bool IsWebView2Available()
|
public static bool IsWebView2Available()
|
||||||
{
|
{
|
||||||
var path = App.Is64Bit
|
try
|
||||||
? @"SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}\"
|
|
||||||
: @"SOFTWARE\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}\";
|
|
||||||
|
|
||||||
using (var key = Registry.LocalMachine.OpenSubKey(path, RegistryKeyPermissionCheck.ReadSubTree))
|
|
||||||
{
|
{
|
||||||
var pv = key?.GetValue("pv");
|
return !string.IsNullOrEmpty(CoreWebView2Environment.GetAvailableBrowserVersionString());
|
||||||
return !string.IsNullOrEmpty(pv as string);
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user