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 Evergreen installer no longer adds the registry key recommended for detection #2019

Closed
psycholns opened this issue Dec 14, 2021 · 5 comments
Assignees
Labels
bug Something isn't working tracked We are tracking this work internally.

Comments

@psycholns
Copy link

psycholns commented Dec 14, 2021

Description
To verify that the webview2 runtime is installed we check (as recommended in https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution) the registry key at:
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}

This has worked so far, but now, if uninstalling the webview2 component and installing it again won't add that key, and therefore our users without the runtime end up in a (manual) install loop.

Verified on 2 machines so far. And looking at our logs it seems to have been an issue since around the 3rd (no errors from installer, but no runtime detected afterwards either).

Version
Runtime: 96.0.1054.53
OS: Win10, 19043
(SDK: 1.0.992.28)
(Framework: WinForms)

Repro Steps

  1. Observe HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5} being present
  2. Uninstall Microsoft Edge WebView2 Runtime
  3. Now the registry key is gone (as expected)
  4. Install Microsoft Edge WebView2Runtime from https://developer.microsoft.com/en-us/microsoft-edge/webview2/#download-section (evergreen bootstrapper)
  5. The registry key is still missing

AB#37397652

@psycholns psycholns added the bug Something isn't working label Dec 14, 2021
@psycholns
Copy link
Author

After further digging around in the registry I figured out that the runtime is now per-user installed (which is great news for our otherwise user installed app!) and thus the key is available here instead:
HKCU\SOFTWARE\Microsoft\EdgeUpdate\Clients{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}

So now it's just a problem for existing software out there and the documentation.

@jasonstephen15 jasonstephen15 self-assigned this Dec 15, 2021
@jasonstephen15 jasonstephen15 added the tracked We are tracking this work internally. label Dec 15, 2021
@jasonstephen15
Copy link
Contributor

Thank @psycholns for the post! @liminzhu made a post about it here: MicrosoftEdge/WebView2Announcements#37. But I agree we should have better permanent documentation about this. I will open an item to update the docs! Let me know if you have any other questions.

@Fowlox
Copy link

Fowlox commented Dec 15, 2021

It is necessary to change from checking hard coded registry path to another way.
Recommend to verifying the runtime installed in the following way.

In .NET based framework (In my case, WPF)

var clientInstalled = true;
try
{
    var version = CoreWebView2Environment.GetAvailableBrowserVersionString();
}
catch (WebView2RuntimeNotFoundException)
{
    clientInstalled = false;
}

In WIN32 platform,

Call GetAvailableCoreWebView2BrowserVersionString(PCWSTR browserExecutableFolder, LPWSTR * versionInfo) and check whether the versionInfo is NULL. If versionInfo is NULL, the WebView2 Runtime isn't currently installed on the client.

I haven't tried this way, but it has been mentioned by Distribute a WebView2 app and the WebView2 Runtime.

@ywmluclt
Copy link

I stucked at it in a while. pleaseeeeee update the document

@ywmluclt
Copy link

ywmluclt commented May 26, 2022

I just checked it again and I realized that:

  • If you install WebView2 Runtime manually (download into local and setup by double click on MicrosoftEdgeWebview2Setup.exe), then the key is available at HKCU\SOFTWARE\Microsoft\EdgeUpdate\Clients{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}
  • If you install WebView2 Runtime by command. In my case, I installed it from NSIS file setup, then the key is available at HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}:
Function installWebView2
	ClearErrors
	ReadRegStr $0 HKLM "SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" "pv"
	${If} ${Errors} 
	${OrIf} $0 == ""
		DetailPrint "Dowloading: WebView2 Runtime"		
		InetLoad::load "http://go.microsoft.com/fwlink/p/?LinkId=2124703" "$TEMP\MicrosoftEdgeWebview2Setup.exe"
        Pop $R0
		StrCmp $R0 "OK" OK
			MessageBox MB_OK|MB_ICONEXCLAMATION "Failed to download WebView2 Runtime. ${PRODUCT_NAME} will continue to install, but the Map in ${PRODUCT_NAME} will not run properly without WebView2 Runtime. You must install WebView2 Runtime manually."
			Goto done_installWebView2_function
        OK:
		DetailPrint "Installing: WebView2 Runtime"
		ExecWait '"$TEMP\MicrosoftEdgeWebview2Setup.exe" /silent /install'
	${EndIf}
	done_installWebView2_function:
FunctionEnd

Just share my experience

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

4 participants