Install .msi from script, detect when install is done

I'm trying to make an install script. I want to install an .msi file, Python, and then install other things after Python is installed. I already see how to do a command-line install. However, msiexec returns right away, even when the install is still running. How would I detect the completion of an msi install from a batch script?


Don't know how Python handles passing commands off to Windows/DOS, but using a plain batch file and the start /wait command the batch file stops and waits until the MSI is done before moving on to the next step.

For example, to install a main app, followed by a patch only when it's finished, and then a final program once that's finished, drop these lines into a .cmd file:

start /wait msiexec /i O12Conv.msi /qb
start /wait msiexec /p O12Convsp1-en-us.msp /qb
start /wait msiexec /i mpsetupedp.msi