WebView2Samples icon indicating copy to clipboard operation
WebView2Samples copied to clipboard

Detzection logic in Bundle.wxs seems wrong

Open KGuetter opened this issue 5 years ago • 8 comments

To detect whether Webview2 is installed, WebView2Samples/SampleApps/WV2DeploymentWiXBurnBundleSample/Bundle.wxs uses <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Value="EBWebView" Variable="WVRTInstalled" Win64="no" />

According to https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution and my own experience, the value should however be "pv", not "EBWebView". i.e. <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Value="pv" Variable="WVRTInstalled" Win64="no" />

KGuetter avatar Nov 23 '20 15:11 KGuetter

I've just hit this issue, it is the same for: https://github.com/MicrosoftEdge/WebView2Samples/blob/master/SampleApps/WV2DeploymentWiXCustomActionSample/Product.wxs

sagoo33 avatar Nov 24 '20 04:11 sagoo33

Nice catch! I've opened a bug on our backlog to get this fixed. Should be an easy one :)

champnic avatar Dec 03 '20 07:12 champnic

According to this, https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#online-only-deployment. There are different registry keys for 32 and 64 bit Windows.

andrewkittredge avatar Jan 26 '21 16:01 andrewkittredge

According to this, https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#online-only-deployment. There are different registry keys for 32 and 64 bit Windows.

That's not an issue. The attribute Win64="no" causes Wix to search the correct tree.

cremor avatar Jun 21 '21 13:06 cremor

The documentation states that there are two registry keys to check: One under HKEY_LOCAL_MACHINE which I assume to be the one for all-users-installs, and one under HKEY_CURRENT_USER, which I assume to be the one for user-specific installs. In the end, the condition should be whether an install usable by the application is present. And that condition is also fulfilled by a user-specific install of WebView2 Runtime. Is it deliberate that the example does not check HKEY_CURRENT_USER but only HKEY_LOCAL_MACHINE?

exaiwitmx avatar Jun 22 '22 08:06 exaiwitmx

Hey @exaiwitmx - No, it is not deliberate. The user-specific install support was added later and the example has not been updated yet. We have that discrepancy tracked in #2107. Thanks!

champnic avatar Jun 23 '22 00:06 champnic

In neither of them (32/64/HKLM/HKCU) does the value EBWebView exist.

cz-dev-ge avatar Jul 15 '22 13:07 cz-dev-ge

I discovered the example seems out of date, for me the key was at <RegistrySearch Id="WVRTInstalled" Root="HKLM" Key="SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\ClientState\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Name="EBWebView" Type="raw"/>

Captnwalker1 avatar Mar 21 '23 14:03 Captnwalker1