PDA

View Full Version : Execwait


Max34
27th January 2006, 08:39
I did an install including MySQL 4.1.
After the installation of MySQL I launch the install of the DB of the application, but this part of the installer doesn't work. The ExecWait command look like this:

ExecWait '"C:\Program Files\mysql\MySQL Server 4.1\bin\mysql.exe" -hlocalhost -uroot -P6808 -p2oo5 < "U:\Database Development\MGIS Database\UPGRADE\Project\install\UploadDB.bat"' $0

I use a batch file in which are listed the SQL command for setting up my DB.
This command line works weel on the shell, but not at all in the NSI script. What is wrong?

glory_man
27th January 2006, 09:07
Try to use ExecDos or nsExec plugin.
Or see here (http://forums.winamp.com/showthread.php?s=&threadid=211806&highlight=execwait+mysql) and here (http://forums.winamp.com/showthread.php?s=&threadid=200797&highlight=execwait+mysql) same discussion.

Takhir
27th January 2006, 09:14
You can test this with cmd /C at the beginning of the command line
ReadEnvStr $0 "ComSpec"
ExecWait '$0 /C "C:\Program Files\mysql\MySQL Server 4.1\bin\mysql.exe" -hlocalhost -uroot -P6808 -p2oo5 < "U:\Database Development\MGIS Database\UPGRADE\Project\install\UploadDB.bat"' $0
or ExecCmd plug-in (http://nsis.sourceforge.net/ExecCmd_plug-in) (2000, XP and later). this thread (http://forums.winamp.com/showthread.php?s=&postid=1846930#post1846930) also may help.

Max34
27th January 2006, 13:27
THANK YOU

This is what I was looking for since one week . My script is working fine now.

MAny many thanks Takhir

Takhir
27th January 2006, 15:10
;) But please note, that on Win95/98 exit code ($0 in your script) may be incorrect. For my test app.exe that hardly coded to exit with 5, I always see 0 on Win98 in the ExecWait. This looks like command.com exit code.