- NSIS Discussion
- ExecWait Problem
Archive: ExecWait Problem
javnav07
12th June 2006 05:28 UTC
ExecWait Problem
I am developing the installer for myapplication using NSIS script.
I have to install mysql and execute the script files to create the database.
The following script i have wrriten for the task
ExecWait 'C:\MYAPPS\Mysql 5.0Setup.exe' $Install_Sql
nsExec::Exec C:\WebPartnerEssentials\3.8\setup\src\Files\dbfiles\sample.bat $1
Pop $1
MessageBox MB_OK "after$1"
But the installer is not waiting for the mysql to be installed before executing the bat file.
Is there any other way to make the installer to wait for the sql installation to be completed?
Thanks a lot people
CancerFace
12th June 2006 09:39 UTC
Try using quotes:
ExecWait '"C:\MYAPPS\Mysql 5.0Setup.exe" $Install_Sql'
nsExec::Exec '"C:\WebPartnerEssentials\3.8\setup\src\Files\dbfiles\sample.bat" $1'
Pop $1
MessageBox MB_OK "after$1"
CF
javnav07
12th June 2006 09:47 UTC
Execwait
hi CancerFace
Thanks for the reply.
But it didn't solve the problem.
What actually i am trying to do is first i need to install mysql and then execute the scripts to create the db in mysql.
CancerFace
12th June 2006 09:53 UTC
In that case you need to see if mysql opens a new thread for installation and as such your installer 'thinks' that the mysql command has finished. I am not familiar with its installation so I cannot be of much help :o(
CF
javnav07
12th June 2006 09:57 UTC
mysql
CancerFace,
You are exactly right.Mysql opens a new thread for installation and it extracts some files and starts installation .Now is there any way i can find that mysql is fully installed and then i can execute the script.
Afrow UK
12th June 2006 10:29 UTC
The setup executable should have a command line switch to stop it running a seperate thread, allowing ExecWait to work correctly.
-Stu
CancerFace
12th June 2006 12:26 UTC
I looked this up on another forum and at least for version 4.1.11 it looks like the MYSQL installer is an MSI wrapped in an EXE. Most likely this is the case for version 5 that you are trying to install. If you run the main exe (Mysql 5.0Setup.exe in your post) go to your temporary folder (usually C:\Documents and Settings\<your username>\Local Settings\Temp) and look for a file called mysql_server.msi or something similar. This is the actual MSI that is called from the exe. You can then use the MSI directly by calling it:
start /wait msiexec.exe /qb /i mysql_server.msi
or use the
Mysql 5.0Setup.exe using whatever switch it needs to run in a single thread. You may want to check
this thread for more info on how to do this.
CF
javnav07
13th June 2006 05:00 UTC
hi CancerFace
Thanks for the reply .
I am very new to NSIS .
I have seen the mysql_server.msi in temp folder after i clicked on the mysql5.0.exe but i am not able to see the file msiexec.exe .But the code i have given ,i have written is for testing purpose only.What exactly i have to do is i have to bundle mysql5.0 with my installer and i have to copy it to client location and execute the .exe .
So before executing the .exe file there will not be any mysql_server.msi in temp folder.So how to execute that.
If u can provide me with samle code it will be of great help to me
Mysql 5.0Setup.exe /? doesn't give me the available options
Not only mysql even i have to install jre first,and then install mysql.
Thanks in advance.
CancerFace
13th June 2006 07:56 UTC
msiexec.exe is the microsoft windows installer and comes bundled with windows (2000 onwards if I am not mistaken).
Look at the Wiki for the Java Runtime, there are plenty of examples on how to deploy that one using NSIS...
CF
javnav07
13th June 2006 08:17 UTC
I am able to exeute the msi file from cmd window.But how to do that from NSIS.
I have tried using nsexec and execwait but i am not able to execute the command "start /wait msiexec.exe /qb /i mysql_server.msi"
CancerFace
13th June 2006 08:33 UTC
Assuming that the msi is located at the same folder as your NSIS script, try
ExecWait '$SYSDIR\msiexec.exe /qb /i "$EXEDIR\mysql_server.msi"'
CF
[Edit]To avoid the sign-up and the configuration wizzards use the following:
ExecWait '$SYSDIR\msiexec.exe /qn /i "$EXEDIR\mysql_server.msi"'
javnav07
13th June 2006 11:29 UTC
Thank you very much CancerFace for your help :).Now i am able to install the mysql successfully.
But before executing the scripts i need to start mysql db .To do that i need to start mysqld-nt.exe and run the scripts.
I will look into that now.