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

WebView2 Runtime does not install correctly #2030

Closed
ChateauLaFite opened this issue Dec 17, 2021 · 31 comments
Closed

WebView2 Runtime does not install correctly #2030

ChateauLaFite opened this issue Dec 17, 2021 · 31 comments
Labels
bug Something isn't working tracked We are tracking this work internally.

Comments

@ChateauLaFite
Copy link

ChateauLaFite commented Dec 17, 2021

Runtime installer at https://go.microsoft.com/fwlink/p/?LinkId=2124703

It did not create the registry key HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}

It did not inform me that it did not install correctly, nor did it prompt for elevation. I am a local Administrator.

WebView2.EnsureCoreWebView2Async() threw a file not found exception until the Runtime was explicitly installed as Administrator.

Explicitly launching the WebView2 Runtime installer as Administrator did create the registry key and the WebView2 control did subsequently work. Deleting the above registry key after installation as Administrator results in successful instantiation of the WebView2 control (and its CoreWebView2), so the presence of the registry key is not required for the WebView2 control to determine if the WebView2 runtime is installed, contradicting the text "If this regkey doesn't exist, or if exists and is null or an empty string, this means that the WebView2 Runtime is not installed on the client." on the page https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution.

Capture

So, to resolve:

  1. WebView2 Runtime installer needs to inform the user if it did not install correctly.

  2. WebView2 Runtime installer did not create the above registry key unless explicitly run as Administrator, and presumably did not install some files. See paragraph 5.

  3. WebView2.EnsureCoreWebView2Async() throws a file not found exception with a null filename, not because the registry key does not exist, but because some required files were not installed (?). The exception does not reveal which file could not be found.

  4. Documentation of how to check if the WebView2 Runtime is installed is incorrect. Presence or absence of registry key doesn't cut it. See paragraph 5.

Attempting to instantiate a WebView2 control in a UWP app (in this case) shows the MessageBox: "Windows cannot access the specified device, path or file. You may not have appropriate permissions to access the item." I can't tell what the item is as the full path is set as the Title of the MessageBox only, and it is not in the MessageBox text, it is truncated, and MessageBox windows are not resizable. This error perhaps can be prevented by specific initialisation options which I have not yet tried.

Multiple entries for Microsoft Edge WebView2 Runtime v96.0.1054.57 are displayed in Windows Programs and Features. Uninstalling one of them seems to work, but attempting to uninstall others entries seemingly does nothing. The WebView2 control does successfully get instantiated at this point. Rebooting the PC does not remove additional entries for WebView2 Runtime from Programs & Features and they (it) can still not be uninstalled. The WebView2 control does successfully get instantiated at this point.

Doc Update: AB#37615931
AB#37743143

@nirbil
Copy link

nirbil commented Dec 20, 2021

I have the same problem.
If I just run the webview installer as is, the webview fails to instantiate as it doesn't find the runtime, probably due the missing registry key.
Rerunning the webview2 installer as an Administrator does resolve the issue.

@geek87G
Copy link

geek87G commented Dec 20, 2021

I have just come across this issue. The registry key is no longer being created. I tested this by uninstalling my existing webview2 runtime, then re installing using both the evergreen bootstrapper and evergreen Standalone.
This is breaking the test to make sure that the WebView2 Runtime is already installed.

@leaanthony
Copy link

💯 same issue

@champnic champnic added bug Something isn't working tracked We are tracking this work internally. labels Jan 6, 2022
@champnic
Copy link
Member

champnic commented Jan 6, 2022

Hey all - thanks for reporting this issue. I know we just made some changes to allow for installing without elevation, but I'm not sure exactly when that shipped or in what version of the installer.

@liminzhu do you have any info you can share? Otherwise I think we may have an installation bug when not elevated.

@leaanthony
Copy link

If it helps.... I've written a workaround so that we launch the installer with elevated privileges. If you don't do that, the regkeys are not created as per the documentation.

@liminzhu
Copy link
Member

liminzhu commented Jan 6, 2022

After getting some feedback around running without elevation, we recently updated our installer to install WebView2 Runtime per-user if run without elevation (previously it'd prompt or fail), and per-machine with elevation. If you run with elevation, the per-machine installation shows up in the HKLM regkey location in our docs. If run without elevation, the per-user installation shows up in the corresponding HKCU location.

With the new change, developer can check both the HKLM and HKCU location before attempting an installation, or what do they used to do, which is checking HKLM and trigger an installation w/ elevation if no HKLM regkey, which will put the per-machine runtime on the box. Sorry our docs haven't been updated yet and I will make sure our docs reflect that!

@champnic
Copy link
Member

champnic commented Jan 6, 2022

Thanks Limin! To be explicit, this is the key that gets written when it's installed per-user:
HKEY_CURRENT_USER\Software\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}

@geekykant
Copy link

geekykant commented Mar 18, 2022

This issue requires quick resolution as its really confusing for the user - to investigate this basic installation check. Just got stuck on this problem over hours now.

@liminzhu
Copy link
Member

hey @geekykant, our docs have been updated to include how per-user or per-machine installation works and what regkeys you need to check. Let me know if you're confused about anything. https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#deploying-the-evergreen-webview2-runtime

@GambaJo
Copy link

GambaJo commented Apr 5, 2022

Same problem here.

@hakzhyena
Copy link

After uninstalling the WebView2 runtime, if we install it again without elevation it gets installed and the registry keys are created in the corresponding HKCU location.
I called GetAvailableCoreWebView2BrowserVersionString() to verify that runtime is installed and as expected versionInfo isn't nullptr which is good.
However, when CreateCoreWebView2EnvironmentWithOptions() is called, in the callback function (OnCreateEnvironmentCompleted()), result is set to 'HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED) : The request is not supported', and the web page doesn't load.
Work around currently to fix this is to install the runtime with elevated privileges instead of non elevated privileges. Is this a known issue that is getting fixed?

@champnic
Copy link
Member

champnic commented Jun 8, 2022

Hey @hakzhyena - What framework are you using to build you app and host the WebView2? The HKCU runtime doesn't work with WinUI2/UWP WebView2 which might be what you are running into.

@hakzhyena
Copy link

Hi @champnic , please ignore my previous comment. I had missed to update the logic to look for path in HKCU for the first parameter (browserExecutableFolder); after doing that CreateCoreWebView2EnvironmentWithOptions is successful and the webpage is loading as expected.

@ramondeklein
Copy link

@champnic I guess UWP isolates registry access, because I had also issues with not being able to load WebView2 from within UWP. Is it only the registry isolation that is problematic or are there other bottlenecks too? We would like to install our application using the Microsoft Store, but most of our end-user don't have administrator access. So we have an issue with the WebView2 runtime installation for UWP apps. What is the recommended approach to fix this?

@champnic
Copy link
Member

champnic commented Aug 8, 2022

@ramondeklein It's the registry and the actual install location of the user-level runtime.

We are doing two things to fix this. 1) We are looking into fixing the permissions of the user-level install location to make sure it's accessible by UWPs, and 2) we are currently pushing out the system-level WebView2 runtime to Windows 10 devices which UWP apps will have access to - rollout is in stages, so you might not see this available right away.

@nirbil
Copy link

nirbil commented Aug 9, 2022

@champnic just to get this clear, once a system-level WebView2 is deployed one wouldn't need to deal with WebView2 installation at all? and this is supposed to be rolled out for all windows devices?

@champnic
Copy link
Member

champnic commented Aug 9, 2022

Yes (unless the user mucks with the installation on their machine) - once the system-level WebView2 Runtime is on the machine, it will keep itself up to date and is usable by all WebView2 apps.

Here's some info on the Win10 runtime rollout:
https://blogs.windows.com/msedgedev/2022/06/27/delivering-the-microsoft-edge-webview2-runtime-to-windows-10-consumers/
It won't be all windows devices, but will be the vast majority of devices that the UWP WebView2 supports (I think it's everything except the Win10 release before the 2018 April update, which our data shows has very very little usage).

@Pholith
Copy link

Pholith commented Aug 25, 2022

I had the same problem, (error 0x80000003 when installing webview2).
Running as administrator on the x86 version worked or me. Thanks

@black-empower
Copy link

We have a problem, that the installation of the webview is kind of arbitrary when integrated in our setup and that setup is installed elevated.
Sometimes it installs per-Machine, sometimes it installs per-User.
It only seems to work consistently if the installer is explicitly started as administrator.
The used setup from us is always the same, the only difference is the installing user or the Virtual Machine used to install the system on.
Is this also a result of this issue?

@mnazers734
Copy link

We just released our UWP Webview2 app to the store and we are now experiencing the same issue. This is very bad experience and communications.

@champnic
Copy link
Member

@mnasers Can you add some detail on what issue you are hitting? Is your app trying to deploy the WebView2 runtime itself?

@mnazers734
Copy link

@champnic No we are not trying to deploy the WebView2 runtime. AFAIK, this is not possible for UWP apps that use MSIX. When certain Windows10 users attempt to launch our app after updating, they are presented the following screen instructing them that the WebView2 runtime needs to be installed along with a link.

WebView2Runtime

After downloading and installing the runtime, users are still not able to open our application and they are presented with the same screen. As mentioned by @ChateauLaFite , the necessary registry entry was missing. Attempting to install the runtime with admin rights solves the issue.

@champnic
Copy link
Member

@mnasers Using the link to download unfortunately defaulted to downloading the per-user version (if it wasn't run elevated). We had a bug that the UWP apps didn't have permissions to access the per-user install, but that should have been fixed about a month ago. If you still have it available, can you see what version of the per-user runtime was installed? If the per-machine/elevated runtime was installed, I believe that removes the per-user install though.

@zbig1000

This comment was marked as off-topic.

@mnazers734
Copy link

@champnic What difference does it make which version is being installed. The end result is the same.

@champnic
Copy link
Member

champnic commented Oct 6, 2022

It matters because we put in a fix into one version. If you share the runtime version we can confirm either 1) That you are using a version without the fix and the issue is expected, with the workaround being to get a newer version or figure out where the older version came from, or 2) That you are using a version with the fix, but the fix is not working as expected, or there is another issue occurring.

@maribeiroleya
Copy link

I have the same problem. I create an app in react-native with lastversion of Microsoft.Web.WebView2 (1.0.1418.22). When i install the app from microsoft store i have the issue
image

What i have to do to resolve the problem??

@champnic
Copy link
Member

champnic commented Nov 3, 2022

@maribeiroleya For that particular machine, it looks like it's missing the WebView2 runtime.
https://developer.microsoft.com/en-us/microsoft-edge/webview2/

For the app in general, it should try and verify that the runtime is available, and potentially install it if it isn't on the machine yet:
https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution

@maribeiroleya
Copy link

@champnic thanks for yout response. I try to verify if the machine have WebView2 runtime installed. My app is a react-native app and winrt/c++. I not found a way to verify this. I cannot access to regedit in a winrt/c++ app. Can you help me to get another way to verify this?

@champnic
Copy link
Member

Typically it's the installer that would check for the presence of the WebView2 Runtime, and install it if it's not on the machine yet. Alternatively the users can follow the instructions that are presented in your screenshot and install the runtime themselves.

@champnic
Copy link
Member

champnic commented Mar 4, 2023

This should be generally fixed now.

@champnic champnic closed this as completed Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tracked We are tracking this work internally.
Projects
None yet
Development

No branches or pull requests