我在 SO 和 Google 上搜索了一段时间,但没有找到相关问题。所以希望这个问题不是重复的。
对于我的一个客户,我正在使用 WiX 创建安装程序工件。一些文件被安装到
[WindowsVolume]\tool\scripts.
只要我手动将这些文件添加到相应的 WiX 片段中就可以了。由于这个组件的文件最近经常被移动和删除,我决定通过 subversion 的 heat.exe 获取它们。我面临的一个问题是,heat 的 -ag 开关拒绝在 [WindowsVolume] 上工作——我猜是因为只要组件目录的路径保持不变, -ag 就会使 GUID 保持静态。因此,我使用 -gg 在每次热运行期间生成新的 GUID。测试人员现在报告说文件没有被替换,并且有时根本没有创建文件夹。
通过设置 -ag 开关使用自动生成的 GUID,我收到以下错误消息:
C:\checkouts\project\Setup\tool.fragment.wxs(41,0): error LGHT0231:
The component 'cmpF69984FE7B4A36DD402E57B30E416ACB' has a key file with path
'TARGETDIR\indexes\arbitrary.file'. 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 中,我有一个主要的 .wxs 定义文件夹、功能和 InstallExecuteSequence。相关文件夹定义为:
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ToolFolder">
<Directory Id="ToolScriptsFolder" Name="scripts"/>
</Directory>
</Directory>
<SetDirectory Id="ToolFolder" Value="[WindowsVolume]tool" />
收获的碎片是:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="ToolScriptsFolder" />
</Fragment>
<Fragment>
<ComponentGroup Id="CG_ToolScripts">
<Component Id="cmp2BCA6A75C5C234BEF6FAD9FC41C4B661"
Directory="ToolScriptsFolder" Guid="*">
<File Id="fil8C1ADEFF76E859B93A97C72A95365E90"
KeyPath="yes" Source="$(var.ToolScripts)\arbitrary.file" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
知道如何在不将工具\脚本移动到 [ProgramFiles] 的情况下使自动生成的 GUID 工作吗?任何使我免于手动编辑片段的帮助表示赞赏:) 提前致谢!