收割文件导致 LGHT0231 错误 [英] Harvesting files leads to LGHT0231 error

查看:14
本文介绍了收割文件导致 LGHT0231 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用最新的 Votive (Wix v3.5) 并创建了一个简单的 Wix VS 2010 安装项目.我添加了我的网站参考并将 Harvest 选项设置为 true.

I'm using latest votive (Wix v3.5) and created a simple Wix VS 2010 setup project. I added my website reference and set the Harvest option as true.

现在,由于我的 INSTALLDIR 指向 IISROOT 下的文件夹,我得到了这个 light.exe 错误:

Now since my INSTALLDIR points to a folder under IISROOT, I get this light.exe error:

[文件路径]:错误 LGHT0231:组件'cmp93982C4086FF8C75F07339DD7CEA8152' 有一个带有路径的密钥文件'TARGETDIRwebdir...[文件名].xml'.由于此路径未植根在标准目录之一(如 ProgramFilesFolder)中,此组件不符合自动生成的标准生成的向导.(如果路径包含可能是标准目录,例如嵌套带有名称的目录ProgramFilesFolder 下的通用文件".)

[filepath]: error LGHT0231: The component 'cmp93982C4086FF8C75F07339DD7CEA8152' has a key file with path 'TARGETDIRwebdir...[filename].xml'. Since this path is not rooted in one of the standard directories (like ProgramFilesFolder), this component does not fit the criteria for having an automatically generated guid. (This error may also occur if a path contains a likely standard directory such as nesting a directory with name "Common Files" under ProgramFilesFolder.)

虽然我了解此错误背后的原因,但我不一定同意其合理性(也许我不了解 Wix MSI 生成的先天工作原理).

While I understand the reason behind this error, I don't necessarily agree to its rational (maybe I don't understand the innate workings of Wix MSI generation).

我该如何解决这个错误?

How can I resolve this error?

提供一些上下文:

我正在尝试结合 Team Build 进行设置.我可以使用旧格式并针对文件夹运行 Heat/Harvest 任务来绕过此问题,但不想走旧路线.

I'm trying to set this up in conjunction with Team Build. I can use the legacy format and run Heat/Harvest task against a folder to bypass this issue but do not want to go the legacy route.

我对新的基于工作流的构建定义玩得还不够,所以不确定如何合并这个自定义任务.

I have not played enough with the new workflow based build definition, so not sure how I can incorporate this custom task.

每次构建安装项目时我都需要运行收获,因为我不想手动跟踪数百个文件.

I need to run harvest every time the Setup project is built because I do not want to keep track of hundreds of files manually.

推荐答案

问题是因为该组件植根于 TARGETDIR,WiX 无法使用 TARGETDIR 自动生成 guid.您可以将 Directory/@ComponentGuidGenerationSeed 添加到该组件上方的目录以避免该问题.通过添加此属性,您现在必须负责确保组件不会在升级过程中安装到两个不同的目录中.

The problem is because the component is rooted in TARGETDIR, which WiX cannot use for automatically generating a guid. You can add Directory/@ComponentGuidGenerationSeed to a directory above this component to avoid the problem. By adding this attribute, you must now take responsibility for ensuring the component doesn't get installed to two different directories across upgrades.

在 Windows Installer 中,组件需要有一个不会在补丁、次要升级和主要升级之间更改的 guid.为方便起见,WiX 可以使用组件的目录层次结构为您生成 版本 5 UUID作为种子.但是,TARGETDIR 不符合此条件.

In Windows Installer, components need to have a guid that doesn't change between patches, minor upgrades, and major upgrades. As a convenience, WiX can generate a version 5 UUID for you using the component's directory hierarchy as the seed. But, TARGETDIR is ineligible for this.

我相信原因是 TARGETDIR 在安装过程中会发生变化(它被设置为具有最多可用空间的驱动器).组件规则之一是必须存储每个组件在单个文件夹中".如果 TARGETDIR 在主要升级之间发生了变化,那么您最终可能会尝试将相同的组件安装到第二个文件夹中.

I believe the reason is that TARGETDIR changes across installations (it's set to the drive that has the most free space). One of the component rules is "each component must be stored in a single folder". If TARGETDIR changed between major upgrades, then you could end up trying to install the same component to a second folder.

这篇关于收割文件导致 LGHT0231 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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