Do WebView2 auto updates occur even if there is a process using WebView2?

975 views Asked by At

Our application use WebView2 and it must be keep running for a week or more. We are concerned that if an uninstall occurs due to a WebView2 update while our application is running, it will be terminated by the Restart Manager.

The PC using this application may not have joined the domain and cannot control or block updates by the GP or registry.

(We believe that if an update is performed and WebView2 uninstallation occurs, the application will be terminated by Restart Manager. GitHub - SessionEnding event is raised when WebView2 is uninstalled )

Is there a possibility that the WebView2 auto update will occur while there are processes using WebView2?

2

There are 2 answers

0
David Risney On BEST ANSWER

The WebView2 runtime has an updater that will run in the background and install updates when they are available. New versions are installed side by side with older versions. Older versions are only removed when no longer in use.

The WebView2 runtime updater works in the same way as the Edge browser updater. When a new version is available the updater will install the new version side by side with any existing versions that are currently in use. The old version will be deleted once its no longer in use. That is, apps with already created WebView2s will continue to use the older version. The CoreWebView2Environment.NewBrowserVersionAvailable event will be raised to tell apps using the old version to move to the new version. Once the apps using the old WebView2 version stop using the old WebView2 version, the older version will be deleted.

New WebView2 instances will be created using the newest available version even if there are other apps using the older version at the same time. One exception to this is if you create a new WebView2 instance that shares a user data folder with an already running WebView2 running with an older WebView2 runtime version. In that case the new WebView2 instance will connect to the already running older versioned WebView2 runtime environment.

0
Yu Zhou On

WebView2 updates the same way as the Edge browser, you can refer to this thread. Edge can search for updates when process is running but can only finish updates after restarting. I think WebView2 should be the same, maybe it can't finish updates when the process is running.

To get more help, I suggest that you can also raise an issue on WebView2 GitHub.