inkeliz/gowebview

ENV not found on window create

Opened this issue · 0 comments

Good morning,

Thanks for this awesome project :)

Before digging, I wonder which environment var I am missing.

While running the simple example,

https://github.com/Inkeliz/gowebview/blob/7afc3ccbda69d02d47905baa94d53100be397b52/gowebview_windows.go#L82

windows config path is set, "C:\Users\***\AppData\Local\Temp\Hello World"

However, the call ends with ERROR_ENVVAR_NOT_FOUND (203) = 0x0

The window is created but then it fails (chan) with this error and bail out with the panic.

I have been using webview/webview directly and I did not need to define envs afaict. Not sure what else it could be :)

Update: It fails to find a registry entry, inside CreateCoreWebView2Environment. Webview alone works tho' (using it directly myself). It could be related to the remarks section here:

To create WebView2 controls that use the installed version of the WebView2 Runtime that exists on user machines, pass a null or empty string to browserExecutableFolder. In this scenario, the API tries to find a compatible version of the WebView2 Runtime that is installed on the user machine (first at the machine level, and then per user) using the selected channel preference.

The current code unsets this variable. That may not behave the same than a NULL||empty string.