Hola amigos, estoy "jugueteando" con TWebView2.
¿Existe algún modo de detectar si el "WebView2 Runtime" está instalado en el sistema?
Gracias,
Hola amigos, estoy "jugueteando" con TWebView2.
¿Existe algún modo de detectar si el "WebView2 Runtime" está instalado en el sistema?
Gracias,
lSisas := IsWebViewAvailable()Hola Leandro, gracias. Pero esa función solo detecta si webview.dll puede cargarse.
En el caso de webview2 no es necesaria.
AngelSalom wrote:Hola Leandro, gracias. Pero esa función solo detecta si webview.dll puede cargarse.Hola :
En el caso de webview2 no es necesaria.
#include "FiveWin.ch"
function Main()
MsgInfo( IsWebView2Available() )
return nil
function IsWebView2Available()
return ! Empty( TWebView2():New():hWebView )Gracias Antonio, simple y efectivo.
Danielmaximiliano wrote:Respecto a esta aproximación, en Windows 7 ( sí aún me quedan clientes usándolo ), da mejor resultado que la propuesta por Antonio, ya que aquella arroja un error de protección si el componente no está instalado.Hola Leandro, gracias. Pero esa función solo detecta si webview.dll puede cargarse.Hola :
En el caso de webview2 no es necesaria.
te suguiero leas https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution?tabs=win32cpp#detect-if-a-webview2-runtime-is-already-installed
Slds
Static Function IsWebView2Available()
// Comprueba en RegEdit si está instalado WebView2
// https://learn.microsoft.com/es-es/microsoft-edge/webview2/concepts/distribution?tabs=dotnetcsharp#detect-if-a-webview2-runtime-is-already-installed
#define HKEY_CURRENT_USER 2147483649 // 0x80000001
#define HKEY_LOCAL_MACHINE 2147483650 // 0x80000002
Local oReg AS Object := nil
Local cPv AS String := ''
oReg := TReg32():New( HKEY_LOCAL_MACHINE, 'SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}', .F. )
cPv := oReg:Get( 'pv' )
if Empty( cPv )
oReg := TReg32():New( HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}', .f. )
cPv := oReg:Get( 'pv' )
endif
if Empty( cPv )
oReg := TReg32():New( HKEY_CURRENT_USER, 'Software\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}', .f. )
cPv := oReg:Get( 'pv' )
endif
return ( .Not. Empty( cPv ) )Muy bien!
No probé la función en Windows 7...