I have a wix installer that will install an XML file and then modify it. Installation works great. Today, I needed to add a couple of nodes to this XML file. So I modified the original file and then added some additional instructions to wix to assign these items values.
Well, I get an error every time saying that it cannot find the node. I look and see what file it has in the directory and it still has the older file that did not have the node. How can I tell it to replace the XML file first and then modify it? I don't want to use "CreateElement" because I don't know how to not create an element if it exists already (haven't tried it, so maybe it'd work). Besides, I want my XML file to be the definition of the configuration.
Here's a sample of my XML:
<Component Id="MyProgExeConfigComponent" Guid="*">
<File
Id="MyProgExeConfig"
Name="MyProg.exe.config"
DiskId="1"
Source="../Published/MyProg/MyProg.exe.config"
PatchWholeFile="yes"
KeyPath="yes"/>
<util:XmlFile
Id="MyProgExeConfigUser"
Action="setValue"
Permanent="yes"
File="[INSTALLLOCATION]\MyProg.exe.config"
ElementPath="/configuration/appSettings/add[\[]@key='UserName'[\]]"
Name="value"
Value="[USER]"/>
<util:XmlFile
Id="MyProgExeConfigPassword"
Action="setValue"
Permanent="yes"
File="[INSTALLLOCATION]\MyProg.exe.config"
ElementPath="/configuration/appSettings/add[\[]@key='Password'[\]]"
Name="value"
Value="[PASSWORD]" />
Any ideas?