Skip to content
⌘ NSIS Forum Archive

How to execute a msi file and wait

13 posts

Adelino Safeca#

How to execute a msi file and wait

Hey Anders? how do I execute a .msi file and wait till it terminates?
I tried to use ExecWait '"msiExec.exe" /i "$INSTDIR\file.msi".
It runs the file but does not wait. Any idea?
Adelino Safeca#
How to execute a msi file and wait

Hey?
I´m embedding .exe files into my installer and it´s working fine using ExecWait "$INSTDIR\file.exe". I install the first and the following waits till the first terminates.

But now I need to execute a .msi file. I am using this command
ExecWait '"msiExec.exe" /i "$INSTDIR\file.msi". It runs the applications I want but does not wait. execute all applications in the same time.
Any Idea? please!
Adelino Safeca#
jpderuiter Thanks for answering.
I followed the link, they say i need to use flags like start/wait installer.exe.
Well, could I do this:
ExecWait "$INSTDIR\ start /wait mysql-installer-community-5.7.18.1.exe"?
Anders#
Ask the author of the .MSI. NSIS will wait for msiexec, anything after that is out of our control...
Adelino Safeca#
I did this:
ExecWait '"msiExec.exe" /qb /1* mysql.txt /i "$INSTDIR\file.msi"'
DOES NOT WORK
jpderuiter#
You should check with the the author of your msi.
There may be a commandline switch which will force msiExec to wait for the msi to finish.

Using "start /wait" is supposed to work also (see https://blogs.msdn.microsoft.com/hea...exe-to-finish/), but I haven't tested this myself, and could not find a working NSIS example.
Kuppy#
nsExec::Exec `"$SYSDIR\msiexec.exe" /a "$EXEDIR\Bin\TryMe.msi" TARGETDIR="$PLUGINSDIR\TestMSI" /qn` 
Adelino Safeca#
Guys I am trying these different ways but getting nothing!
Anyway thanks!
If anyone get it solved, please let me know!
jpderuiter#
So you're trying to install MySQL community installer?

See https://noelherrick.com/books/mysql-...stalling-mysql
Try de "/q" and "/i" commandline switches.
Anders#
Originally Posted by Kuppy View Post
nsExec::Exec `"$SYSDIR\msiexec.exe" /a "$EXEDIR\Bin\TryMe.msi" TARGETDIR="$PLUGINSDIR\TestMSI" /qn` 
nsExec is for console applications, a normal ExecWait is enough for MSIExec.