Posted by Brian Clifton
Written September 4, 2008 at 12:25
If you just invoke an MSI (Microsoft Installer) package from the command line, msiexec will execute asynchronously. To get around this you can use start /wait from your batch file. This will create the process and wait for it to exit. Type start /wait before the command line you'd normally pass to msiexec.exe like so:
start /wait msiexec.exe /i MyMSI.msi /l*v MyMSI.log
The batch file would be blocked until msiexec.exe finishes. Programmatically this is the same as invoking msiexec.exe with CreateProcess and waiting for the process to return from WaitForSingleObject with no timeout.