-1

We have to introduce the WebView2 in order to use Google Maps into our WinForms project and we cannot have the Evergreen Runtime installed on all the numerous PCs.
Currently our compile weighs 25Mb.
If we add the NuGet libraries of WebView2 and the FixedVersionRuntime, the compile becomes over 500Mb (20 times bigger).

Our questions:

1 - Is it compulsory to release the entire FixedVersionRuntime on every single pc? (I'm afraid I understand yes, but I'm a dreamer...)

2 - At runtime when the WebView2 control is instantiated, a "[ProjectName]WebView2" folder is also created within the executable directory. From our first tests we have observed that this folder tends to get bigger. Does anyone know if this folder is managed automatically by the runtime or if you have to worry about cleaning it up?

3 - On MSDN it is instructed to use the "WebView2LoaderPreference" property to distribute WebView2 as a single file:
https://learn.microsoft.com/en-us/microsoft-edge/webview2/how-to/static?source=recommendations
It is not clear to us if the meaning of this property is what we would like, that is to have a single WebView2 library to release (hoping it will take up less space...). In any case it is not clear how it works: inserting the property apparently does not change anything in the compiled files.

Thanks in advance for any advice.

mcarugati
  • 59
  • 8
  • 1
    What is the problem with distributing the run-time automated installer in those machines? It also provides updates on its own and it's available to all applications that use WebView2. You then just need the `Core`, `WinForms` and `WebView2Loader` libraries -- The same argument could be made in relation to distributing .Net 6+ applications – Jimi Oct 04 '22 at 10:44
  • This article: [Distribute your app and the WebView2 Runtime](https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution) is more recent than the one you linked – Jimi Oct 04 '22 at 10:49
  • @Jimi Our particular customer does not have the possibility to manage a massive installation of the Evergreen runtime. The link you attached describes well how to use the FixedVersionRuntime, but unfortunately it doesn't go into the details of our doubts highlighted above. We have updated point 2 because we discovered that the "[ProjectName] WebView2" folder is apparently generated by the runtime, but even on this we haven't found much additional information. In the meantime, thanks Jimi for the answer. – mcarugati Oct 04 '22 at 12:32
  • The WebView2 x64 run-time installation package is 132 MB. You can ship it with your app, doesn't need to be downloaded – Jimi Oct 04 '22 at 12:54
  • 132 Mb unfortunately remains 5 times the current size of the entire project. Technically this is a problem in our particular context. We are trying to find a way to further reduce the weight of the components to be released, with little hope of succeeding. – mcarugati Oct 04 '22 at 13:12
  • @Jimi ultimately with our customer we accepted that the only possibility is to install the runtime somehow online, so as to release only the 1.5Mb installer. Thanks for support. – mcarugati Oct 04 '22 at 14:23

1 Answers1

0

Ultimately the best option remains to install the EvergreenRuntimeVersion online, so as to release only the 1.5Mb installer. This component is also already present in Windows 11, so it will tend to become more and more comfortable to use as customers adopt Windows 11.

Alternatively the only option is to release the entire FixedRuntimeVersion which occupies more than 370Mb.

mcarugati
  • 59
  • 8