Archive: problem with WriteINIStr and DeleteINISec


problem with WriteINIStr and DeleteINISec
Hi...

I have a problem!
I would like to enter a path in a document. However goes only through a section_name! I would like to however again delete this section_name!

If I use then DeleteINISec, it deletes me not only section_name, but also entry_name.

The reason is: I have a .bat-file, which I would like to change. However it indicates then in the MS-DOS an error, if I open it. Because the section_name is still in it.


Can someone please help me??

WriteINIStr "$INSTDIR\ms_oc4j.bat" "SecMAGICK_HOME" "set MAGICK_HOME" "$INSTDIR\bin"
WriteINIStr "$INSTDIR\ms_oc4j.bat" "SecINSTDIR " "set INSTDIR" $INSTDIR

by


Use FileOpen, FileWrite and FileClose to write to batch files.
Or use ConfigWrite which is in one of the NSIS useful headers.

-Stu


The batch file is exist!

And i want to change some of the lines! Not all!

ConfigWrite doesn't exist on my eclipse installer?!

Why?


(my english is not very good ... sorry ;) )


See the NSIS documentation > Useful Headers

-Stu


thx...

but i have another problem:
the funktion FileOpen, FileWrite and FileClose is very good ... but how can i write in a batch at the 5.line?



example:
Text of a batch:
set PATH=C:\Dokumente und Einstellungen\oy\workspace\Primes\bin
set MAGICK_CODER_MODULE_PATH=C:\Dokumente und Einstellungen\oy\workspace\Primes\bin\modules\coders
set MAGICK_HOME=C:\Dokumente und Einstellungen\oy\workspace\Primes\bin

How can i cange "set MAGICK_HOME=C:\Dokumente und Einstellungen\oy\workspace\Primes\bin" to "set MAGICK_HOME=C:\Programm\MAGICKHOME\bin"?


I use this function:

ClearErrors
FileOpen $3 $INSTDIR\ms_oc4j.bat a
IfErrors done
FileWrite $3 "set JAVA_HOME=$INSTDIR"
FileClose $3


thx


http://nsis.sourceforge.net/Write_to...le_line_number

-Stu


thx a lot!!!!!