托管引导程序应用程序“无法解析文件源" [英] Managed Bootstrapper Application "Failed to resolve source for file"

查看:23
本文介绍了托管引导程序应用程序“无法解析文件源"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我开始创建自己的自定义托管引导程序应用程序之前,我使用下面的现有 Fragment 没有任何问题,即如果找不到本地文件,它将从 Internet 下载 .msi.现在,当我尝试执行 MBA 时,我在日志文件中收到以下错误.

Before I started creating my own custom Managed Bootstrapper Application, I was using the existing Fragment below with no issues, i.e. it would download the .msi from the internet if the local file was not found. Now when I try to execute the MBA I get the error below in the log file.

[环境]
WiX 3.7、Visual Studio 2012、x64

[Environment]
WiX 3.7, Visual Studio 2012, x64

[Bundle.wxs]

[Bundle.wxs]

[片段.wxs]

<PackageGroup Id="ReportViewer">
  <MsiPackage DisplayName="Microsoft Report Viewer 2012 Runtime"
              Cache="no" Compressed="no" ForcePerMachine="yes" Permanent="yes" Vital="yes"
              SourceFile="C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages\ReportViewer\ReportViewer.msi"
              DownloadUrl="http://go.microsoft.com/fwlink/?LinkID=217022"
              InstallCondition="(VersionNT >= v6.0 OR VersionNT64 >= v6.0)"/>
</PackageGroup>

[日志]

[14:42]i101:检测到包:ReportViewer.msi,状态:不存在,缓存:无

[14:42]i101: Detected package: ReportViewer.msi, state: Absent, cached: None

[14:54]i201:计划包:ReportViewer.msi,状态:缺席,默认请求:存在,请求ba:存在,执行:安装,回滚:无,缓存:是,未缓存:是,依赖:注册

[14:54]i201: Planned package: ReportViewer.msi, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: None, cache: Yes, uncache: Yes, dependency: Register

[15:00]w343:提示包来源:ReportViewer.msi,有效载荷:ReportViewer.msi,路径:E:\ReportViewer.msi
[15:00]e054:无法解析文件源:E:\ReportViewer.msi,错误:0x80070002.
[15:00]e000:错误 0x80070002:提示输入源时失败(原始路径E:\ReportViewer.msi").
[15:00]e313:无法获取有效负载:ReportViewer.msi 到工作路径:C:\Users\POS1User\AppData\Local\Temp{416b9117-e1b4-4518-b13d-eb5416da8794}\ReportViewer.msi,错误:0x0200.

[15:00]w343: Prompt for source of package: ReportViewer.msi, payload: ReportViewer.msi, path: E:\ReportViewer.msi
[15:00]e054: Failed to resolve source for file: E:\ReportViewer.msi, error: 0x80070002.
[15:00]e000: Error 0x80070002: Failed while prompting for source (original path 'E:\ReportViewer.msi').
[15:00]e313: Failed to acquire payload: ReportViewer.msi to working path: C:\Users\POS1User\AppData\Local\Temp{416b9117-e1b4-4518-b13d-eb5416da8794}\ReportViewer.msi, error: 0x80070002.

推荐答案

当本地不存在包时,Burn 引擎会要求您的引导程序应用程序处理 ResolveSource 调用.如其他堆栈溢出答案所述,您应该为 ResolveSource 事件添加自己的事件处理程序.您可以简单地指示 Burn 为您下载软件包:

When a package is not present locally, the Burn engine asks your bootstrapper application to deal with the ResolveSource call. As explained in this other Stack Overflow answer, you should add your own event handler for the ResolveSource event. You can simply instruct Burn to download the package for you:

this.Bootstrapper.ResolveSource += OnResolveSource;

...

private void OnResolveSource(object sender, ResolveSourceEventArgs e)
    if (!File.Exists(e.LocalSource) && !string.IsNullOrEmpty(e.DownloadSource))
        e.Result = Result.Download;
}

这篇关于托管引导程序应用程序“无法解析文件源"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆