繁体   English   中英

WiX CustomActionData在名为CustomAction的位置为空

[英]WiX CustomActionData is empty in called CustomAction

再一次,我遇到了问题,这可能很容易解决。
我想扩展一个使用WiX创建的设置,以便对已安装程序的配置文件进行更改。 为了做到这一点,我创建了一个CustomAction 为了能够更改配置文件,我需要知道它在CustomAction中的(安装)位置。 因此,我尝试将INSTALLLOCATION和Filename传递给我的CustomAction 这就出现了问题: CustomActionData -Attribute始终为空,安装程序抛出异常。

我的CustomAction是一个C#DLL文件: DemoDatumErzeugen.CA.dll 它包含一个修改配置文件的方法DatumEintragen 我试图以这种方式访问​​数据:

string path = session.CustomActionData["LOCATION"];

这是引发异常的地方。 我只收到了德语错误信息,但它说了一句话: The supplied key was not found in the dictionaryDer angegebene Schlüssel war nicht im Wörterbuch angegeben. )。

这是我尝试将属性从我的setup-script传递到自定义操作的方法:

<Binary Id="DemoDatumEinrichtenCA" SourceFile="DemoDatumErzeugen.CA.dll"/>

<CustomAction Id="DemoDatum.SetProperty" Return="check" Property="DatumEintragen" Value="LOCATION=[INSTALLLOCATION];NAME=StrategieplanConfig.xml;"/>
<CustomAction Id="DemoDatum" BinaryKey="DemoDatumEinrichtenCA" DllEntry="DatumEintragen" Execute="deferred" Return="check" HideTarget="no"/>

<InstallExecuteSequence>
  <Custom Action="DemoDatum.SetProperty" After="InstallFiles"/>
  <Custom Action="DemoDatum" After="DemoDatum.SetProperty"/>
</InstallExecuteSequence>

我已经看过很多例子,它们以相同的方式完成,或者至少非常相似。 我已经尝试了很多东西,但似乎没有什么比在<Custom Action="DemoDatum.SetProperty" After="InstallFiles"/>之后更改值<Custom Action="DemoDatum.SetProperty" After="InstallFiles"/>帮助。 CustomActionData始终为零。
我检查它: session.CustomActionData.Count
再一次,我非常感谢任何帮助或提示我做错了什么。

DemoDatum.SetPropertyProperty属性值应等于延迟操作的Id属性值。 因此,要么将属性名称更改为DemoDatum ,要么将延迟操作的Id更改为DatumEintragen

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM