Install .msi from script, detect when install is done
20,949
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
Related videos on Youtube
Author by
Claudiu
Updated on September 17, 2022Comments
-
Claudiu over 1 year
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?-
John Gardeniers over 13 yearsDo you have any control over the msi file at all? Can you break it down modify it and repackage?
-
Claudiu over 13 yearsno it's not my msi file
-
-
jscott over 13 years+1, When using
start
watch for thetitle
"bug". Paths containing a space will be interpreted as thetitle
portion of the command line arguments. Use something like:start "" /wait msiexec /i some.msi /qb
just to ensuretitle
is set. -
GAThrawn over 13 years@jscott Hadn't heard of that problem before, but we've always stored our installers on a specific installer share, and all folder names on that share are strictly 8.3 with no spaces, as there've been so many odd quirks with badly written installers in the past that it ended up easier to keep everything simple.