Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 18th July 2006, 05:53   #1
Cyong
Junior Member
 
Join Date: Jul 2005
Posts: 11
adding to existing files and not replacing

ok i got an interesting problem, i have a game that is customizable so that people can put in their own charecters.

The file listing the directory of each charecter is pretty straight forward

PHP Code:
<Name>x2</name>
<
Name>x3</name>
<
Name>x4</name>
<
Name>x5</name>
<
Name>x6</name
now people can add any charecter they want so the file can easily change and look like

PHP Code:
<Name>x2</name>
<
name>Custom</name>
<
Name>x3</name>
<
Name>x4</name>
<
Name>x5</name>
<
Name>x6</name
in updates i want to be able to simply add the new lines of code to the file instead of just replacing it, that way my users wont have to re-edit the file after every update. any suggestions?
Cyong is offline   Reply With Quote
Old 18th July 2006, 10:16   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,216
Try this function:
http://nsis.sourceforge.net/Write_to...le_line_number

If you don't know what line to write to, you can use:
http://nsis.sourceforge.net/ReplaceB...kers_in_a_file
And replace between </name> and <Name>.

These functions are old, so I also recommend using the TextReplace plugin.

-Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 19th July 2006, 07:15   #3
Cyong
Junior Member
 
Join Date: Jul 2005
Posts: 11
Quote:
Originally posted by Afrow UK
Try this function:
http://nsis.sourceforge.net/Write_to...le_line_number

If you don't know what line to write to, you can use:
http://nsis.sourceforge.net/ReplaceB...kers_in_a_file
And replace between </name> and <Name>.

These functions are old, so I also recommend using the TextReplace plugin.

-Stu
hmm thanks, might have to change a few things (add a line at the bottom of the code to spcify what can be replaced) but it should do the trick. Thanks
Cyong is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump