WIX Installer(.MSI)因WebView2运行时注册表检测失败求助
WebView2运行时安装检测逻辑失效导致安装失败
我们在应用安装流程中,将WebView2运行时安装程序作为二进制流嵌入,通过注册表检测来决定是否执行安装,但目前出现安装错误导致流程中断,且测试机器已预装WebView2运行时,预期的跳过逻辑未生效。
以下是product.wxs中的关键配置:
步骤1:属性与自定义动作定义
<Property Id="WVRTINSTALLED"> <RegistrySearch Id="WVRTInstalled1" Root="HKLM" Key="SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Name="pv" Type="raw" /> <RegistrySearch Id="WVRTInstalled2" Root="HKLM" Key="SOFTWARE\Microsoft\EdgeUpdate\Clients{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Name="pv" Type="raw" /> <RegistrySearch Id="WVRTInstalled3" Root="HKCU" Key="SOFTWARE\Microsoft\EdgeUpdate\Clients{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Name="pv" Type="raw" /> </Property> <Binary Id="MicrosoftEdgeWebview2Setup.exe" SourceFile="C:\Users\source\setup dependency\MicrosoftEdgeWebview2Setup.exe"/> <CustomAction Id='InvokeBootstrapper' BinaryKey='MicrosoftEdgeWebview2Setup.exe' Execute="deferred" ExeCommand=' /install' Return='check' />
步骤2:自定义动作调度
<Custom Action="CloseAppsPrompt" After="CostFinalize"></Custom> <Custom Action='InvokeBootstrapper' Before='InstallFinalize'> <![CDATA[NOT(REMOVE OR WVRTINSTALLED)]]> </Custom>
我们按照官方示例实现上述逻辑,预期实现:检测多个注册表项,若机器未安装WebView2则执行安装,已安装则跳过,但当前逻辑未达成预期,且安装失败。
内容的提问来源于stack exchange,提问作者Vladimir21
相关产品推荐
相关产品推荐

