jchv/go-webview2

webviewloader.GetInstalledVersion bugs

Closed this issue · 2 comments

I found a few bugs in GetInstalledVersion in webviewloader:

  • It uses the err return from Call (which in turn calls GetLastError) when it should use the HRESULT that comes back in the first error. This results in the most recently posted error "The specified module could not be found." being erroneously reported from the failed attempt to load the DLL as a file (which since I'm relying on the embedded one will always fail).
  • A copy paste error exists where a code path calls nativeCompareBrowserVersions.

The outcome of this is that I have no good way to detect if WebView2 is installed, and thus if I need to trigger installation.

I experimented and found what I believe is a fix:
frazeradam#1

jchv commented

Thanks for looking into this; some of that code is not well-tested. I'd really like if there was a way we could do an integration test of it in CI. I may look into it if i get a chance.

As far as I'm concerned the code here is definitely broken, feel free to open a PR on this repo.

@jchv I have entered PR #52 to address the issues.