如何在WiX中加热空目录?
以下是cakebuild脚本:如何在WiX中加热空目录?,wix,Wix,以下是cakebuild脚本: WiXHeat(Directory("../Release"), new FilePath("./xxx/Files.wxs"), WiXHarvestType.Dir, new HeatSettings { AutogeneratedGuid = true, ComponentGroupName = "Binaries", Transform = "./Filter.xslt", SuppressCom = true,
WiXHeat(Directory("../Release"), new FilePath("./xxx/Files.wxs"), WiXHarvestType.Dir, new HeatSettings
{
AutogeneratedGuid = true,
ComponentGroupName = "Binaries",
Transform = "./Filter.xslt",
SuppressCom = true,
SuppressFragments = true,
SuppressRegistry = true,
SuppressRootDirectory = true,
PreprocessorVariable = "var.xxx.TargetDir",
DirectoryReferenceId = "INSTALLFOLDER",
WorkingDirectory = "./xxx_Installer",
KeepEmptyDirectories = true,
GenerateGuid = true,
});
它使用参数:-ke-ag-gg
Files.wxs看起来像:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="INSTALLFOLDER">
<Directory Id="dir76A8B56EDC1C4DD3CB4177F3704BC91E" Name="data">
<Component Id="cmpE375532277DA492834892BE47B02E5DA" Guid="*" KeyPath="yes">
<CreateFolder />
</Component>
</Directory>
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="Binaries">
<ComponentRef Id="cmpE375532277DA492834892BE47B02E5DA" />
</ComponentGroup>
</Fragment>
</Wix>
那么Light不能与Files.wxs一起使用,下面是错误:
…\Files.wxs(29):错误LGHT0230:Component/@Guid属性的
值“*”对此组件无效,因为它不符合
具有自动生成的guid的条件。组件
将目录用作键路径或包含ODBCDataSource子目录
元素不能使用自动生成的guid。确保你的
组件没有目录a。请单击键路径并移动任何
ODBCDataSource子元素到具有显式组件的组件
guids。执行任务“BuildInstaller”时出错。错误:
指示灯:进程返回错误(退出代码230)
看来,对于空目录,它必须有一个指定的公会,而不是“*”根据
我不想手动用GUID替换“*”,因为热/光进程与构建进程集成,Files.wxs在源代码管理中
您知道如何修复此错误吗?我添加了此代码段,WiX Light工作正常
<xsl:template match="wix:Directory[@Name='data']/wix:Component/@Guid">
<xsl:attribute name="Guid">
<xsl:value-of select="'E8A26678-FA90-4BFC-846F-4E79AE55D44D'"/>
</xsl:attribute>
</xsl:template>
请说明这是否是正确的解决方案。您可以同时使用热参数-ag和-gg 要么我错过了什么,要么 -ag-在编译时自动生成组件Guid,例如set Guid=“*” -gg-立即生成guid。运行heat时,所有组件都会获得guid 来源 不能同时满足 而且,由于在生成GUID期间,您的指示灯随后会出现故障,因此我建议只尝试-gg,而不尝试-ag。这也帮了我处理空目录