收集文件会导致 LGHT0231 错误
我正在使用最新的 votive (Wix v3.5) 并创建了一个简单的 Wix VS 2010 安装项目。我添加了我的网站引用并将 Harvest
选项设置为 true
。
现在,由于我的 INSTALLDIR
指向 IISROOT 下的文件夹,因此我收到以下 light.exe 错误:
[文件路径]:错误 LGHT0231:组件 'cmp93982C4086FF8C75F07339DD7CEA8152' 有一个带有路径的密钥文件 'TARGETDIR\webdir...[文件名].xml'。由于该路径没有root 在标准目录之一(如 ProgramFilesFolder)中,这 组件不符合自动执行的标准 生成的指南。 (如果路径包含 可能的标准目录,例如嵌套具有名称的目录 ProgramFilesFolder 下的“公用文件”。)
虽然我了解此错误背后的原因,但我不一定同意其合理性(也许我不了解 Wix MSI 生成的固有工作原理)。
我该如何解决这个错误?
提供一些背景信息:
我正在尝试将其与 Team Build 结合起来进行设置。我可以使用旧格式并对文件夹运行 Heat/Harvest 任务来绕过此问题,但不想走旧路线。
我还没有充分利用基于新工作流程的构建定义,因此不确定如何合并此自定义任务。
每次构建安装项目时我都需要运行收获,因为我不想手动跟踪数百个文件。
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
.
Now since my INSTALLDIR
points to a folder under IISROOT, I get this light.exe error:
[filepath]: error LGHT0231: The component
'cmp93982C4086FF8C75F07339DD7CEA8152' has a key file with path
'TARGETDIR\webdir...[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.)
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?
To provide some context:
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是因为该组件植根于 TARGETDIR,WiX 无法使用该组件自动生成 guid。您可以将
Directory/@ComponentGuidGenerationSeed
添加到此组件上方的目录中以避免出现此问题。通过添加此属性,您现在必须负责确保组件不会在升级过程中安装到两个不同的目录中。在 Windows Installer 中,组件需要有一个在补丁、次要升级和主要升级之间不会更改的 guid。为了方便起见,WiX 可以使用组件的目录层次结构为您生成版本 5 UUID作为种子。但是,
TARGETDIR
不符合此条件。我相信原因是
TARGETDIR
在安装过程中发生变化(它设置为具有最多可用空间的驱动器)。组件规则之一是“必须存储每个组件在单个文件夹中”。如果TARGETDIR
在主要升级之间发生更改,那么您最终可能会尝试将相同的组件安装到第二个文件夹。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.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.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". IfTARGETDIR
changed between major upgrades, then you could end up trying to install the same component to a second folder.