Skip to content

Commit

Permalink
Merge pull request #2092 from lubos/develop
Browse files Browse the repository at this point in the history
Fixing WebView2 detection mechanism
  • Loading branch information
cwensley authored Dec 23, 2021
2 parents 1e8142d + 3f67e0f commit 84b2f0c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Eto.Wpf/Forms/Controls/WebView2Handler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,15 @@ public static bool Detect()
#if TEST_INSTALL
return false;
#endif
var versionInfo = CoreWebView2Environment.GetAvailableBrowserVersionString();
// If versionInfo is NULL, the WebView2 Runtime isn't currently installed on the client.
return versionInfo != null;
try
{
var versionInfo = CoreWebView2Environment.GetAvailableBrowserVersionString();
return versionInfo != null;
}
catch (WebView2RuntimeNotFoundException)
{
return false;
}
}

/// <summary>
Expand Down

0 comments on commit 84b2f0c

Please sign in to comment.