Archive: Create a file


Create a file
Hello,

Here is what I want to do. During installation process, I have copied a file called install.bat on the INSTDIR. This file is empty.

I would like to open it and add the following content

SET CLASSPATH=$INSTDIR\lib\econf.jar
java be.ac.fundp.infonet.econf.installer.Install $INSTDIR

Close the file and then call it. Would it be possible?

Regards,

Stephane


Ok something is easier for me. How can you write

" in a command

for instance I want to show Hello "World!"

How can we do this?


How about:

FileOpen $R0 "$INSTDIR\install.bat" a
FileSeek $R0 0 END
FileWrite $R0 "SET CLASSPATH=$INSTDIR\lib\econf.jar"
FileWrite $R0 "java be.ac.fundp.infonet.econf.installer.Install $INSTDIR"
FileClose $R0
ExecWait "$INSTDIR\install.bat"

-H


When using FileWrite, how do you tell it to start the next instance of FileWrite in a new line?

When I use the following code:

FileWrite $R0 "@echo off"
FileWrite $R0 "cls"

I end up with "@echo off" and "cls" on the same line.

-Carlos


$\r$\n, under Windows at least.

So the above example probably should have been:

FileOpen $R0 "$INSTDIR\install.bat" a
FileSeek $R0 0 END
FileWrite $R0 "SET CLASSPATH=$INSTDIR\lib\econf.jar$\r$\n"
FileWrite $R0 "java be.ac.fundp.infonet.econf.installer.Install $INSTDIR$\r$\n"
FileClose $R0
ExecWait "$INSTDIR\install.bat"


Thanks!!!!!

Now i would like to monitor the response code and open a message box different

if errorcode=1 then MB_OK "Installation complete"
if errorcode=2 then MB_OK "An error occured ..."

:D