wry icon indicating copy to clipboard operation
wry copied to clipboard

Platform-specific note for Windows (Webview2 redistribution)

Open fr-an-k opened this issue 1 year ago • 10 comments

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 avatar May 18 '24 06:05 fr-an-k

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.

fr-an-k avatar May 18 '24 06:05 fr-an-k

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.

FabianLars avatar May 18 '24 09:05 FabianLars

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.

fr-an-k avatar May 18 '24 09:05 fr-an-k

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).

FabianLars avatar May 18 '24 10:05 FabianLars

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.

fr-an-k avatar May 18 '24 10:05 fr-an-k

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

SkyLeite avatar Jun 07 '24 20:06 SkyLeite

maybe related https://github.com/actions/runner-images/issues/9538

bukowa avatar Jun 29 '24 14:06 bukowa

I only seem to be able to download the fixed version for arm64, why is that? Did this change?

BeneSim avatar Jan 13 '25 20:01 BeneSim

@BeneSim Just in case you didn't see it, the links for x86(_64) seem to be back now. They were gone for me too when you wrote the comments but now they're back.

FabianLars avatar Jan 20 '25 15:01 FabianLars

@BeneSim Just in case you didn't see it, the links for x86(_64) seem to be back now. They were gone for me too when you wrote the comments but now they're back.

@FabianLars Didn't see it indeed, thanks you for letting me know :)

BeneSim avatar Feb 21 '25 08:02 BeneSim

I am facing this issue as well, but I don't really understand the workaround from this thread. Can someone explain/document a bit better?

jpambrun avatar Oct 28 '25 12:10 jpambrun