<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nsis.sourceforge.io/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ladenedge</id>
	<title>NSIS Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://nsis.sourceforge.io/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ladenedge"/>
	<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/Special:Contributions/Ladenedge"/>
	<updated>2026-04-21T22:41:07Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Talk:NsisXML_plug-in_(by_Wizou)&amp;diff=18094</id>
		<title>Talk:NsisXML plug-in (by Wizou)</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Talk:NsisXML_plug-in_(by_Wizou)&amp;diff=18094"/>
		<updated>2010-02-10T00:59:37Z</updated>

		<summary type="html">&lt;p&gt;Ladenedge: Sample code for .NET config files&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Many people find known memory leaks unacceptable. Granted, the NSIS probally won&#039;t listen on a port, and the memory will probally be freed after te process exits on 2000+. However, I don&#039;t think 9x cleans up memory too well and I&#039;ve discovered memory leaks in my code that I wrote on a 2000 machine when it crashed on a NT 4.0 Machine. --[[User:Zippy1981|Zippy1981]] 08:56, 5 September 2006 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Example Code - .NET Config Files ==&lt;br /&gt;
&lt;br /&gt;
I&#039;m using this plugin to adjust .NET config files.  It works wonderfully.  Here&#039;s what it looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
!macro AdjustConfigValue ConfigFile Key Value&lt;br /&gt;
&lt;br /&gt;
   DetailPrint &amp;quot;Config: adding &#039;${Key}&#039;=&#039;${Value}&#039; to ${ConfigFile}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
   nsisXML::create&lt;br /&gt;
   nsisXML::load ${ConfigFile}&lt;br /&gt;
&lt;br /&gt;
   nsisXML::select &amp;quot;/configuration/appSettings/add[@key=&#039;${Key}&#039;]&amp;quot;&lt;br /&gt;
   nsisXML::setAttribute &amp;quot;value&amp;quot; ${Value}&lt;br /&gt;
&lt;br /&gt;
   nsisXML::save ${ConfigFile}&lt;br /&gt;
&lt;br /&gt;
!macroend&lt;br /&gt;
&lt;br /&gt;
!insertmacro AdjustConfigValue &amp;quot;$INSTDIR\MyApp.exe.config&amp;quot; &amp;quot;ServiceURL&amp;quot; &amp;quot;http://127.0.0.1&amp;quot;&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a URL to a config file that resembles the following one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-xml&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;configuration&amp;gt;&lt;br /&gt;
  &amp;lt;appSettings&amp;gt;&lt;br /&gt;
    &amp;lt;add key=&amp;quot;ServiceURL&amp;quot; value=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/appSettings&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&lt;br /&gt;
&amp;lt;/highlight-xml&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that in this case the specified key is being &#039;&#039;updated&#039;&#039;, not added.  That is nice for me because my test environment (and what&#039;s in SVN) already includes the key.&lt;br /&gt;
&lt;br /&gt;
It works by making an XPath query to the config file for an element named &#039;add&#039; with an attribute &#039;key&#039; equal to whatever variable &amp;lt;tt&amp;gt;${Key}&amp;lt;/tt&amp;gt; is passed into the macro.  It&#039;s probably not hard to see how it might be adjusted for database connection strings.&lt;br /&gt;
&lt;br /&gt;
Good luck!  --[[User:Ladenedge|Ladenedge]] 00:59, 10 February 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Ladenedge</name></author>
	</entry>
</feed>