jchv/go-webview2

Webview2Loader.dll not detected

leaanthony opened this issue ยท 4 comments

Hey there ๐Ÿ˜„ Looks like webviewloader cannot detect WebView2Loader.dll in every scenario except if it is alongside the binary. Is that because the official DLL isn't in a default library directory? Cheers.

jchv commented

In which directory are you trying to have it pick up WebView2Loader.dll from? In theory we should be getting the Standard Search Order for Desktop Applications.

Yeah, I assumed that if you use NewLazyDLL("WebView2Loader.dll") it would search those paths and also assumed that "WebView2Loader.dll" would be installed in one of those paths. I mean, it's a lot of assumptions granted ๐Ÿ˜‚

jchv commented

Yeah, Webview2Loader won't be installed in a system directory, to my understanding; it's part of the Webview2 SDK, not the runtime. You need to have it bundled with your app. That's the main reason why go-webview2 bundles it and uses go-winloader.

Webview2Loader doesn't have a whole lot of functionality in it, though. It mainly exists to just provide the logic for finding and loading Webview2. I have reverse engineered it over here: OpenWebView2Loader.

(Addendum: go-webview2 attempts to load from disk first so that you can swap in a new binary without needing to recompile.)

I think porting that to Go would be fun!