support/install_command.ps1 in mixlib-install-1.0.11 vs support/install_command.ps1 in mixlib-install-1.0.12

- old
+ new

@@ -41,14 +41,23 @@ else { throw "SHA256 for $dst $dsha256 does not match $sha256" } } Function Install-Chef($msi) { Log "Installing Chef Omnibus package $msi" - $p = Start-Process -FilePath "msiexec.exe" -ArgumentList "/qn /i $msi" -Passthru -Wait - $p.WaitForExit() - - if ($p.ExitCode -ne 0) { throw "msiexec was not successful. Received exit code $($p.ExitCode)" } - + $installingChef = $True + $installAttempts = 0 + while ($installingChef) { + $installAttempts++ + $p = Start-Process -FilePath "msiexec.exe" -ArgumentList "/qn /i $msi" -Passthru -Wait + $p.WaitForExit() + if ($p.ExitCode -eq 1618) { + Log "Another msi install is in progress (exit code 1618), retrying ($($installAttempts))..." + continue + } elseif ($p.ExitCode -ne 0) { + throw "msiexec was not successful. Received exit code $($p.ExitCode)" + } + $installingChef = $False + } Remove-Item $msi -Force Log "Installation complete" } Function Log($m) { Write-Host " $m`n" }