On Fri, Jan 31, 2014 at 2:42 PM, John Cooper <jocoo...@jackhenry.com> wrote:

> Change your ElementPath to have the XPath without the /@value and add a
> Name attribute to util:XmlFile with the value "value".  It should work.
>


Thanks for the tip!

I tried that change with just the APIURL Util:XmlFile (which was working
before), it continued to work OK with that change. But when I add the other
Util:XmlFile's back in for the nlog entries, it errors again.


Action 15:33:02: ExecXmlFile.
ExecXmlFile:  Error 0x800710d8: failed to find node:
/configuration/nlog/rules/logger in XML file: C:\MyApp\MainApp.exe.config
Error 25532. Failed to find node:
/configuration/nlog/rules/logger[@writeTo='file'] in XML file:
C:\MyApp\MainApp.exe.config, system error: -2147020584
Action ended 15:33:03: InstallFinalize. Return value 3.
Action 15:33:03: Rollback. Rolling back action:


At the time of this error, before I hit "OK" and it gets rolled back, the
.config is present with the contents below. The APIURL is still set to
http://localhost instead of the replacement value too (which is weird since
that XmlFile entry worked great on its own), I guess it's trying to make a
temporary copy of the config somewhere and editing it elsewhere before
moving it into place?


<?xml version="1.0" encoding="utf-8"?>
<configuration>
  ... snip ...
  <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance";>
    <targets>
      <target name="console" xsi:type="ColoredConsole" layout="${longdate}
(${level}) [${callsite}]: ${message}" />
      <target name="file" xsi:type="File"
fileName="C:\Pulse\PulseUpdater\PulseUpdater.log" layout="${longdate}
(${level}) [${callsite}]: ${message}" />
    </targets>
    <rules>
      <logger name="*" minlevel="Debug" writeTo="file" />
      <logger name="*" minlevel="Debug" writeTo="console" />
    </rules>
  </nlog>
  <appSettings>
    <add key="APIURL" value="http://localhost/api"; />
  </appSettings>
</configuration>


Here are the updated Util:XmlFile's I'm trying:


        <Util:XmlFile Id="UpdateApiUrl"
          Action="setValue"
          File="[MainInstallFolder]MainApp.exe.config"
          SelectionLanguage="XPath"
          Permanent="yes"
          PreserveModifiedDate="yes"
          ElementPath="/configuration/appSettings/add[\[]@key='APIURL'[\]]"
          Name="value"
          Value="[APIURL]"
        />

        <Util:XmlFile Id="UpdateNlogFileLogLevel"
          Action="setValue"
          File="[MainInstallFolder]MainApp.exe.config"
          SelectionLanguage="XPath"
          Permanent="yes"
          PreserveModifiedDate="yes"

ElementPath="/configuration/nlog/rules/logger[\[]@writeTo='file'[\]]"
          Name="minlevel"
          Value="[NLOGLEVELFILE]"
        />

        <Util:XmlFile Id="UpdateNlogConsoleLogLevel"
          Action="setValue"
          File="[MainInstallFolder]MainApp.exe.config"
          SelectionLanguage="XPath"
          Permanent="yes"
          PreserveModifiedDate="yes"

ElementPath="/configuration/nlog/rules/logger[\[]@writeTo='console'[\]]"
          Name="minlevel"
          Value="[NLOGLEVELCONSOLE]"
        />


Cheers (from KC too no less, small world)!
Jeremy
------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to