gpt4 book ai didi

xml - WIX 安装程序 : Cannot set more than one appSettings node

转载 作者:数据小太阳 更新时间:2023-10-29 02:29:59 27 4
gpt4 key购买 nike

我在 wix 安装程序中有以下内容:

<util:XmlFile Id="leID4" File="[INSTALLFOLDER]app.config" Sequence="5"
Action="setValue" ElementPath="/configuration/appSettings/add[\[]@key='JobProcessorTimerInterval'[\]]/@value" Value="60000" Permanent="yes" />

<util:XmlFile Id="leID5" File="[INSTALLFOLDER]app.config" Sequence="6"
Action="setValue" ElementPath="/configuration/appSettings/add[\[]@key='FromEmail'[\]]/@value" Value="[FROMEMAIL]" Permanent="yes" />

这是我的 app.config 文件:

<configuration>
<appSettings>
<add key="FromEmail" value="test@hotmail.com" />
<add key="JobProcessorTimerInterval" value="60000"/>
</appSettings>
</configuration>

当我运行安装程序时,我收到此消息:

enter image description here

我尝试了多种方法,但似乎无法正常工作。谁能看出我哪里出错了?

最佳答案

你能试试下面的吗? WIX 文档指出:

"setValue - Sets a value in the element specified in the ElementPath. If Name is specified, and attribute with that name is set to the value specified in Value. If Name is not specified, the text value of the element is set. Value is a required attribute if setValue is the action specified."

    <util:XmlFile Id="leID4" 
File="[#filename]"
Sequence="5"
Action="setValue"
ElementPath="//appSettings/add[\[]@key='JobProcessorTimerInterval'[\]]"
Name="value"
Value="60000"
Permanent="yes"
SelectionLanguage="XPath" />

<util:XmlFile Id="leID5"
File="[#filename]" Sequence="6"
Action="setValue"
ElementPath="//appSettings/add[\[]@key='FromEmail'[\]]"
Name="value"
Value="[FROMEMAIL]"
Permanent="yes"
SelectionLanguage="XPath" />

<File Id="filename" Name="xmlfiletest" Source="..\\xmlfile1.xml">
</File>

filename 是您的 WIX 中 app.config 文件的 FILE 元素的 ID 属性。

关于xml - WIX 安装程序 : Cannot set more than one appSettings node,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26367229/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com