Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Platform-specific note for Windows (Webview2 redistribution) #1268

Open
fr-an-k opened this issue May 18, 2024 · 7 comments
Open

Platform-specific note for Windows (Webview2 redistribution) #1268

fr-an-k opened this issue May 18, 2024 · 7 comments

Comments

@fr-an-k
Copy link

fr-an-k commented May 18, 2024

With the x86_64-pc-windows-gnu target (cross-compilation) you automatically opt for the fixed version redistribution of Webview2. That's worthy of documentation.

The executable will give an error about WebView2Loader.dll because the wry documentation does not mention (yet) that you have to get the redistribution from here:
https://developer.microsoft.com/en-us/microsoft-edge/webview2?form=MA13LH#download
And choose a fixed version.

Details: https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution

@fr-an-k
Copy link
Author

fr-an-k commented May 18, 2024

Actually it requires a code change, because you have to pass the distribution path to the CreateCoreWebView2EnvironmentWithOptions call; it doesn't work if you just place the files alongside the executable.

@FabianLars
Copy link
Member

you automatically opt for the fixed version redistribution of Webview2

That's not true, what makes you think that? The need for the .dll is correct though, wry's docs are still from the time where we only supported the msvc toolchain.

@fr-an-k
Copy link
Author

fr-an-k commented May 18, 2024

The error happens if you add wry on a x86_64-pc-windows-gnu target.
The dynamic linkage seems to be a fallback for not finding the static webview2 Nuget library (in WSL Ubuntu in my case), which is probably an extra installation step outside of msvc, if possible at all.

@FabianLars
Copy link
Member

Yes, the dll error/requirement is expected and really just how it works. What i mean is that this has no effect on whether you can use webview2 in evergreen mode or the fixed version and i'd like to know if we said something different somewhere (so we can update it).

@fr-an-k
Copy link
Author

fr-an-k commented May 18, 2024

I just think this is important in the platform notes of the readme, or notes on cross-compilation.

I didn't see any installation steps in the readme (github homepage) and I'm not a Windows specific developer so I know nothing about nuget or msvc and my expectation is that I don't have to do further research to make it work and avoid errors.

A reference to the Microsoft docs would be helpful but it would be better if developers can just copy paste an install command to avoid many people wasting time on figuring out the same issue.

@SkyLeite
Copy link

SkyLeite commented Jun 7, 2024

Fwiw I reached this issue after running into the described error :)

@bukowa
Copy link
Contributor

bukowa commented Jun 29, 2024

maybe related actions/runner-images#9538

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants