|
|
#1 |
|
Member
Join Date: Apr 2006
Location: Somewhere in Germany
Posts: 81
|
Howto change un-normal ini entries?
Hi together.
I have a problem with an .ini file. It looks like this: [section] entry = whatever.dll entry = another.dll entry = andsoon.dll When I say "writeinistr" it replaces the first 'entry' with the new value. :| How can I arrange this? |
|
|
|
|
|
#2 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
I doubt if this is a proper INI when all entries have the same name.
Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#3 | |
|
Member
Join Date: Apr 2006
Location: Somewhere in Germany
Posts: 81
|
Quote:
My problem is that the main product is already released and my installation is an addon for this product which requires to add this setting. Any ideas? Edit: I talked to one of the devs. He told me that they just read the "entry"'s in a array and uses them. Of course, the .ini isnt nicely designed but I still need to fix this problem. :| |
|
|
|
|
|
|
#4 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
You may use word functions header to find/replace the required value, however, I guess you understand that the INI is useless whatsoever.
http://nsis.sourceforge.net/Docs/AppendixE.html#E.3 Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#5 | |
|
Member
Join Date: Apr 2006
Location: Somewhere in Germany
Posts: 81
|
Quote:
[section] entry = whatever.dll entry = another.dll entry = andsoon.dll entry = myadded.dll On unInstall I could use a WordReplace function but I have currently no idea how to .) check if this entry was already written to the ini .) add the entry without destroying another value Thank you very much for your help so far, Red Wine! Edit: The programm itself (for which the INI settings for) has no problems parsing the INI file and using the values. The only problem is myself adding more ununique values. |
|
|
|
|
|
|
#6 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
Then remove the old INI (no matter if the entry is written or not) and install a new one which includes myadded.dll.
Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#7 | |
|
Member
Join Date: Apr 2006
Location: Somewhere in Germany
Posts: 81
|
Quote:
|
|
|
|
|
|
|
#8 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
Hmm! The INI has only one section, or several?
Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#9 | |
|
Member
Join Date: Apr 2006
Location: Somewhere in Germany
Posts: 81
|
Quote:
|
|
|
|
|
|
|
#10 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
What about this?
Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#11 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
Easiest solution is to loop through the existing file and compare each line with entry = myadded.dll$\r$\n. If that line isn't found, seek to the end then write the new line.
Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#12 |
|
Member
Join Date: Apr 2006
Location: Somewhere in Germany
Posts: 81
|
Thanks for you replies. I will test the init.zip today (very special thanks!!) and report if its working for me. A dev told me that if he has to much time he will write a command-line util for me that handles this behaviour.
Thanks all! |
|
|
|
|
|
#13 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
The example above works fine if the entry doesn't exist, though, it fails when the entry already exists.
The following example should work in every case, Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|