Old 30th August 2006, 17:28   #1
Baafen
Junior Member
 
Join Date: Aug 2006
Location: Sweden
Posts: 9
Writing to ini

Im trying to make an installer that writes to an ini file. I have made so the ininstaller writes what I entered in field 1-6 but I wont to make så whats entered in field 1 has "" so If I enter test the installer should write "test" but that wont work.

Write code:
Quote:
FileWrite $9 "$0 $1 $2 $\r$\n"
I have tryed:
Quote:
FileWrite $9 ""$0" "$1" "$2" $\r$\n"
But then I get an error then i try to compile.

Is there an better way to write to the ini file?

I would like to have to ability to choose what line to write to. For example if there is some text in the ini file i should write it to a new line. For example line 33.

// sorry for my bad english I hope you understand me
Baafen is offline   Reply With Quote
Old 30th August 2006, 17:39   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
What is wrong with WriteINIStr?

-Stu
Afrow UK is offline   Reply With Quote
Old 30th August 2006, 18:11   #3
Baafen
Junior Member
 
Join Date: Aug 2006
Location: Sweden
Posts: 9
I can try WriteINIStr but can I make "$1" then?

I tryed it and didnt get what I wontet. I field 1 you enter one thing and in field 2-3 you enter something other. and I wont it to write like this: "thing1" "thing2" "thing3" but I was not able to do that
Baafen is offline   Reply With Quote
Old 30th August 2006, 21:47   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Like this:
WriteINIStr "$PLUGINSDIR\file.ini" "Field 1" "State" '"thing1" "thing2"'

-Stu
Afrow UK is offline   Reply With Quote
Old 31st August 2006, 11:02   #5
Baafen
Junior Member
 
Join Date: Aug 2006
Location: Sweden
Posts: 9
Now I get " but its still like I wont it to be.. In the ini files I get

Quote:
[Field 1]
State="thing1" "thing2"
But I only wont
Quote:
"Thing1" "Thing2"
Baafen is offline   Reply With Quote
Old 31st August 2006, 23:27   #6
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
Seems what you want is not a standard INI file...

Look at the Text Function headers included with NSIS. There are some text file manipulation function that might work better for you. (the LineFind function might be what you are looking for.)

You might also want to browse the NSIS Developer Center for other plugins/functions that would help you achive your goals.

If you are still stumped, it might help to post a few example lines from your unique INI file to better illustrate what you are trying to accomplish.
Comperio is offline   Reply With Quote
Old 1st September 2006, 14:56   #7
Baafen
Junior Member
 
Join Date: Aug 2006
Location: Sweden
Posts: 9
Thanks I will take a look at that and see if I can make it work
Baafen is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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