Archive: How to get the execution stderr


How to get the execution stderr
Hi,

I'm currently facing a problem with the ExecWait function.

In my installer I have to invoke a number of deployed binaries.

I use an ExecWait call that looks like this :

ExecWait "$INSTDIR\mysql\bin\mysql.exe -u root < $INSTDIR\config\scripts\mysqlgrant.sql"

The problem is that I can see a shell window opening, and a bunch of error messages displayed, just before the window closes. Of course the closing is very fast, and I don't have the time to read any of the messages.

I tried to add a 2> $INSTDIR\myerr.log in the exec param, in order to re-direct the stderr and check the errors, but it did not help. The log file was empty.

I also tried to add && pause in the
exec line, hoping taht it would prevent the window from closing but without success.

Eventually I tried to put all these commands in a bat file, and make it exec, but was still unable to find the logs or the errors.

I also tried some variations of the exec line like :

ExecWait '"$INSTDIR\mysql\bin\mysql.exe" -u root < $INSTDIR\config\scripts\mysqlgrant.sql"'

or

'"$INSTDIR\mysql\bin\mysql.exe" -u root < "$INSTDIR\config\scripts\mysqlgrant.sql"'

without any success ...

So dos anyone have a suggestion on how to debug a case like this ?

Is there any function that would allow me to exec a program and get it's stout & stderr ?

Any help would be greatly appreciated !

Thanks


You have to use the command line interpreter. See this thread for more information.

You might also want to use nsExec to avoid the pop-up of the command window.


Thanks a lot !

I'll take a look at this rigth away !!!!

PS : sorry to post a question that was already answered, but it is not that easy to find the info on the forum !