Xojo Edge WebView2 via DesktopXAMLContainer

Just a guess, but it probably isn’t used by default because there are still user systems out there that don’t have it. WebView2 ships with Win11 but is optional on Win10. There’s logic to detect for this though (which anyone who’s using XAML WebView2 should be using anyway before their windows load):

Var WebView2Installed As Boolean
Try
  Var reg As New RegistryItem( _ 
   "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}", False)
  WebView2Installed = (reg.Value("pv").StringValue.Trim <> "")
Catch err As RegistryAccessErrorException
  WebView2Installed = False
End Try

Also I’ve had isolation issues when using it in application packers (BoxedApp type packers) in both Xojo and other languages.

3 Likes

Oh I’m going to have to adjust my container to fall back then. This won’t be pretty!

I still cannot get it to show the right click menus in the right place. Every thing else works. In the interim, I can compile in 32 bit, so I am using this and it works, and fixed the only issue I was still having. I just imported it as a OLE component.

My approach has been to direct the user to the installer and not let them continue in the app until it’s detected.

If you’re using WebView2ControlMBS, you can test the result of the method AvailableCoreWebView2BrowserVersionString, which I believe returns the same string as the registry check.

1 Like