Archive: including just a line ...help !


including just a line ...help !
  Hello !!

i search to include just this line in my nsi script..for winamp3 of course

<section name="{45F3F7C1-A6F3-4EE6-A15E-125E92FC3F8D}">
<entry name="New playlist name" value="nouvelle" />

(the last string)

i try with the script XML ( joined to this post) to write :
Push "$INSTDIR\studio.xnf"
Push '<entry name="New playlist name" value="'
Push 'nouvelle" />'
Push '<section name="{45F3F7C1-A6F3-4EE6-A15E-125E92FC3F8D}">'
Call XML_Replace

but don't match..
Do i need the script ..or can i do more easyly...

thanks for you help


What is going wrong? Does it change anything in the file?


no..nothing..no changement ....
i ask me why he don't make any string changement ...:eek:

Do you have an idea.or perhaps directly the NSI lines ? :p


Is the line you need to replace always at the same location?


yes , normaly !

do you ( you or somebodyelse want my studio.xnf ?


If just want to replace a line have a look here:
http://www.clantpa.co.uk/nsis/wiki/index.php/FileRead

If you want to just add a line, just open the file with the 'a' mode, seek to the end, write a line break just to be sure, and then write your line.

There is no need for any XML specific scripts for these two cases.
If I miss understood your problem, please tell me.


Looks like he wants to change an attribute (value) on a tag (entry) that exists inside another tag (section) so really you'd need to walk the xml properly to reliably change the value.

winampfr, is this what you are trying to do? e.g. change this :-

...

<
section ...>
</section>
<section name="{45F3F7C1-A6F3-4EE6-A15E-125E92FC3F8D}">
<entry name="New playlist name" value="some value" />
</section>
<section ...>
</section.>
...
to this :-
...

<
section ...>
</section>
<section name="{45F3F7C1-A6F3-4EE6-A15E-125E92FC3F8D}">
<entry name="New playlist name" value="nouvelle" />
</section>
<section ...>
</section.>
...

<section name="{45F3F7C1-A6F3-4EE6-A15E-125E92FC3F8D}">
<entry name="New playlist name" value="nouvelle" />
yes it's that !
but don't match in my .nsi script...can i give you my .nsi ? or..
Push "$INSTDIR\studio.xnf"
Push '<entry name="New playlist name" value="'
Push 'nouvelle" />'
Push '<section name="{45F3F7C1-A6F3-4EE6-A15E-125E92FC3F8D}">'
may be corrected ?

Send me your .xml file you are trying to change please :) (or attach it here)

Ignore that - I remembered I have Winamp3 installed so I'm looking at my studio.xnf :)


I just tried an example, changing the nplaylists value from 9 to nouvelle. It worked fine. My code was :-


Push "$INSTDIR\\studio.xnf" 

>Push '<entry name="nplaylists" value="'
>Push 'nouvelle" />'
>Push '<section name="{45F3F7C1-A6F3-4EE6-A15E-125E92FC3F8D}">'
>Call XML_Replace
>
Please send me your .xnf file because mine does not have the "New playlist name" entry in the file so I can't test exactly what you are trying to do.