Hi I am trying to change a value setting in a config file using the following:
<Component Id="Enable32BitAppPoolComponent" Guid="*" Directory="INSTALLLOCATION">
<CreateFolder/>
<util:XmlConfig Id="Enable32BitAppPool" Node="value"
ElementPath="//configuration/system.applicationHost/applicationPools/add[\[]@name='DefaultAppPool'[\]]/@enable32BitAppOnWin64"
File="[inetsrv]\config\applicationHost.config"
Value="true" On="install"/>
</Component>
This code does not change the value in the applicationHost.config
file. I tried adding the action="create"
but I then got the error during the setup that it could not open the XML file. What am I doing wrong?
I think it's more convenient to use XmlFile elements to modify attribute values:
You have to correctly assign the Sequence number in the snippet above.
The Sequence attribute is also missing in your XmlConfig element, so that might be a problem with your code. Another problem is the definition of the
ElementPath
attribute. Adding@enable32BitAppOnWin64
to it is wrong. TheElementPath
attribute locates the element you want to change, in your case theadd
element which has thename
attribute ofDefaultAppPool
. In that element you want to change the value of an attribute. You specify the attribute by its name. For that purpose you have to add thename
attribute to yourXmlConfig
element. In combination with theNode
attribute set tovalue
the attribute definition is complete. TheAction
attribute of the XmlConfig element has to be set tocreate
. TheVerifyPath
attribute of the XmlConfig element is used to determine if the Node shall be added or modified.The correct version of your XmlConfig element should look like this:
If your installer tells you it cannot open the XML File, then you have to check if the
File
attribute's value is correct. Maybe you need to change it to something like"[INSTALLFOLDER]\config\applicationHost.config"
or whatever you set theId
attribute of your installation directory to. The installer log should provide you with the information which file could not be opened.