ExecWait Update Mysql not work, Batch file ok
Hello forum,
With my installer I install a mysql database.
After installation a table should be updated. (A directory path)
If I do it in this way the update is not be done.
------------------------------------------------
Section "UpdateMySQLDatabase"
SetOutPath $TEMP
FileOpen $0 updatedir.sql w
FileWrite $0 "UPDATE directoriestable SET RootDirectoriesPath='$Mod_INSTDIR2' WHERE RootDirectoriesKeyName='DirectoriesMain';$\r$\n"
FileClose $0
ExecWait '"$INSTDIR\mysql\bin\mysql.exe" -uroot -ppassword -Dtestdb < "$TEMP\updatedir.sql"'
SectionEnd
-----------------------------------------------------
The command ;
ExecWait '"$INSTDIR\mysql\bin\mysql.exe" -uroot -ppassword -Dtestdb < "$TEMP\updatedir.sql"'
is wrong or is not be executed.
But if I put the same into a batch file and execute this, all works fine.
-------------------------------------------------------
Section "UpdateMySQLDatabase"
SetOutPath $TEMP
FileOpen $0 updatedir.sql w
FileWrite $0 "UPDATE directoriestable SET RootDirectoriesPath='$Mod_INSTDIR2' WHERE RootDirectoriesKeyName='DirectoriesMain';$\r$\n"
FileClose $0
FileOpen $0 updatedir.bat w
FileWrite $0 "@echo off $\r$\n"
FileWrite $0 '"$INSTDIR\mysql\bin\mysql.exe" -uroot -ppassword -Dtestdb < "$TEMP\updatedir.sql"'
FileClose $0
ExecWait "$TEMP\updatedir.bat";
SectionEnd
------------------------------------------------------
Two questions:
1. What is wrong with the first version without the batch file?
2. How can I debug the ExecWait "Dos" window?
I see that there is an error in it, but the messages are so quick that I cannot read it and the window will be closed quickly.
Is there any way to pause the ExecWait or is there an option to debug the ExecWait or the complete installer script with all output?
thanks a lot
regards
hawk