OsmanY22
2nd August 2006 15:54 UTC
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
Afrow UK
2nd August 2006 16:02 UTC
Use FileOpen, FileWrite and FileClose to write to batch files.
Or use ConfigWrite which is in one of the NSIS useful headers.
-Stu
OsmanY22
2nd August 2006 16:08 UTC
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 ;) )
Afrow UK
2nd August 2006 16:13 UTC
See the NSIS documentation > Useful Headers
-Stu
OsmanY22
2nd August 2006 16:29 UTC
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
OsmanY22
3rd August 2006 08:53 UTC
thx a lot!!!!!