Wix XmlFile:在ElementPath中使用XPath属性时无法卸载

时间:2014-05-21 23:53:39

标签: xml xpath wix visual-studio-2013 uninstall

我正在尝试在卸载期间从XML文件中删除条目。

这是有问题的代码:

<util:XmlFile Id='XmlSettings1' File='[InstallDir]Station.config' Action='createElement' Name='Control' ElementPath='//StationConfig/ControlManager/Controls' Sequence='1' />
<util:XmlFile Id='XmlSettings2' File='[InstallDir]Station.config' Action='setValue' Name='name' Value='Fusion' ElementPath="//StationConfig/ControlManager/Controls/Control[\[]not(@name)[\]]" Sequence='2' />
<util:XmlFile Id='XmlSettings3' File='[InstallDir]Station.config' Action='setValue' Name='enable' Value='true' ElementPath="//StationConfig/ControlManager/Controls/Control[\[]@name='Fusion'[\]]" Sequence='3' />

失败如下:

  

无法在XML文件中找到node:// StationConfig / ControlManager / Controls / control [not(@name)]:C:\ InstallDir \ Station.config,系统错误:-2147020584

我的猜测是,它试图从序列3开始撤消更改,但是当它到达#2时,它不知道如何处理[not(@name)]和把手举起来。

有没有办法让它直接跳到序列#1并在卸载过程中删除整个元素?

0 个答案:

没有答案