Old 16th August 2017, 09:52   #1
Adelino Safeca
Junior Member
 
Join Date: Jul 2017
Posts: 11
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 is offline   Reply With Quote
Old 16th August 2017, 10:17   #2
Adelino Safeca
Junior Member
 
Join Date: Jul 2017
Posts: 11
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 is offline   Reply With Quote
Old 16th August 2017, 10:57   #3
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
http://nsis.sourceforge.net/When_I_u...esn't_wait
jpderuiter is offline   Reply With Quote
Old 16th August 2017, 11:31   #4
Adelino Safeca
Junior Member
 
Join Date: Jul 2017
Posts: 11
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"?
Adelino Safeca is offline   Reply With Quote
Old 16th August 2017, 11:54   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,610
Ask the author of the .MSI. NSIS will wait for msiexec, anything after that is out of our control...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 16th August 2017, 12:09   #6
Adelino Safeca
Junior Member
 
Join Date: Jul 2017
Posts: 11
I did this:
ExecWait '"msiExec.exe" /qb /1* mysql.txt /i "$INSTDIR\file.msi"'
DOES NOT WORK
Adelino Safeca is offline   Reply With Quote
Old 16th August 2017, 12:18   #7
Adelino Safeca
Junior Member
 
Join Date: Jul 2017
Posts: 11
What do u mean?
There's no way to solve it?
Adelino Safeca is offline   Reply With Quote
Old 17th August 2017, 10:05   #8
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
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.
jpderuiter is offline   Reply With Quote
Old 17th August 2017, 10:42   #9
Kuppy
Junior Member
 
Join Date: Sep 2016
Posts: 34
PHP Code:
nsExec::Exec `"$SYSDIR\msiexec.exe" /a "$EXEDIR\Bin\TryMe.msi" TARGETDIR="$PLUGINSDIR\TestMSI" /qn
Kuppy is offline   Reply With Quote
Old 17th August 2017, 12:40   #10
Adelino Safeca
Junior Member
 
Join Date: Jul 2017
Posts: 11
Guys I am trying these different ways but getting nothing!
Anyway thanks!
If anyone get it solved, please let me know!
Adelino Safeca is offline   Reply With Quote
Old 17th August 2017, 13:56   #11
Adelino Safeca
Junior Member
 
Join Date: Jul 2017
Posts: 11
But the Author of "MySQL Installer Community.msi" is ORACLE!, Not?
Adelino Safeca is offline   Reply With Quote
Old 17th August 2017, 16:25   #12
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
So you're trying to install MySQL community installer?

See https://noelherrick.com/books/mysql-...stalling-mysql
Try de "/q" and "/i" commandline switches.
jpderuiter is offline   Reply With Quote
Old 17th August 2017, 18:04   #13
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,610
Quote:
Originally Posted by Kuppy View Post
PHP Code:
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.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump