WiX CustomActionData在名为CustomAction的位置为空

Ska*_*lli 12 c# custom-action wix wix3.5

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

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

string path = session.CustomActionData["LOCATION"];
Run Code Online (Sandbox Code Playgroud)

这是引发异常的地方.我只得到了德国的错误信息,但它说,沿着线的东西:The supplied key was not found in the dictionary(Der 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>
Run Code Online (Sandbox Code Playgroud)

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

Yan*_*nko 17

Property属性值DemoDatum.SetProperty应等于Id延迟行动的属性值.因此,要么将属性名称更改为,要么将延迟操作DemoDatum更改IdDatumEintragen.