Msiexec is not a console application. It is a windows application. When msiexec starts control is immediately passed back to PowerShell. This is the equivalent of using the "start" command in a command prompt. This means that msiexec is still executing when PowerShell executes the next command. To force PowerShell to wait until msiexec completes you should pipe its output to out-null.
msiexec /i path\to\setup.msi ... | out-null # next command will only execute after msiexec truly completes Edwin G. Castro Software Developer - Staff Electronic Banking Services Fiserv Office: 503-746-0643 Fax: 503-617-0291 www.fiserv.com Please consider the environment before printing this e-mail > -----Original Message----- > From: Kevin Burton [mailto:kev...@buyseasons.com] > Sent: Friday, March 11, 2011 3:09 PM > To: General discussion for Windows Installer XML toolset. > Subject: [WiX-users] msiexec returning before it is done? > > This isn't a WiX question directly but hopefully someone will have some > experience they would be willing to share. > > I am using PowerShell to run msiexec on a remote machine. Right after I zip > up the files that were installed. But PowerShell is too quick because by the > time I get to executing the zip command the files have not been copied. I > don't see any arguments to msiexec that say "wait until you are done". Is > there any indicator that tells me that msiexec is done? > > Kevin Burton > Senior Software Engineer > BUYSEASONS > 262-901-2000 Office > 262-901-2312 Fax > kev...@buyseasons.com > ------------------------------------------------------------------------------ > Colocation vs. Managed Hosting > A question and answer guide to determining the best fit for your > organization - today and in the future. > http://p.sf.net/sfu/internap-sfd2d > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users