英文:
WIX v4 Unable to reference action state of a feature in the custom element property condition
问题
当尝试向操作的"Install Execute Sequence"添加自定义操作条件时,如果引用功能的操作状态时使用了"&",则构建将失败。
在构建时,出现以下错误:
错误 WIX0104:不是有效的源文件;详细信息:'&'是一个意外的令牌。期望的令牌是';'。
但是,"&Main;" 不是一个已定义的实体。
我认为在条件中的"&Main"之后需要一个分号,因为条件已移至属性,并且我认为XML解析器期望它。因此,我不确定这是否是版本4中的一个错误,还是是否应该有一种新的标记来匹配这个功能,这在这里有文档记录:
我无法找到关于Wixtoolset版本4的条件属性实现的任何文档,因为现有文档目前没有提供任何解释。
英文:
When trying to add a custom action condition to the Install Execute Sequence of that action. The build will fail when the action state of a feature is referenced via the '&'.
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package Name="New App" Manufacturer="Coder" Version="1.0.0.0" Scope="perMachine" UpgradeCode="56858172-dbce-452f-855c-2c24cc44a192">
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" />
<MediaTemplate EmbedCab="true"/>
<Property Id="POWERSHELL" Value="powershell.exe"/>
<CustomAction Id="PsInstallSkdTasks" Property="POWERSHELL" Return="asyncNoWait" ExeCommand="-File &quot;[INSTALLFOLDER]\InstallScheduledTasks.ps1&quot;" />
<InstallExecuteSequence>
<Custom Action="PsInstallSkdTasks" OnExit="success" Condition="(?CompPsIns = 3) AND ((!Main = 3) OR (&Main = 3))" />
</InstallExecuteSequence>
<Feature Id="Main" Level="1" AllowAdvertise="false" Display="expand" Title="Main App" Description="Descr...">
<ComponentGroupRef Id="CompGrpMain" />
</Feature>
</Package>
</Wix>
When I attempt to build this I get the following error:
error WIX0104: Not a valid source file; detail: ' ' is an unexpected token. The expected token is ';'.
But then '&Main;' is not a defined entity.
I believe it wants a semicolon after &Main in the condition because the condition has been moved to a property and I believe the XML parser is expecting it. So I'm not sure if this is a bug in version 4 or if there is meant to be a new notation to match this functionality that is documented here:
I've been unable to find any documentation of the implementation of the condition property for version 4 of the Wixtoolset, as the existing documentation provides no explanations at this time.
答案1
得分: 0
你不能在XML中使用裸露的&
。请使用&amp;
代替。
英文:
You can't use a naked &
in XML. Use &amp;
instead.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论