Skip to content

Commit

Permalink
chocolatey-visualstudio.extension: ignore null exit code when waiting…
Browse files Browse the repository at this point in the history
… for VS installer processes

GitHub-Issue: GH-13
  • Loading branch information
jberezanski committed May 15, 2018
1 parent 128c24c commit 8a72da5
Showing 1 changed file with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function Wait-VSInstallerProcesses
{
$exitCode = $proc.ExitCode
}
if ($proc.ExitCode -ne 0)
if ($proc.ExitCode -ne 0 -and $proc.ExitCode -ne $null)
{
Write-Warning "$($proc.Name) process $($proc.Id) exited with code $($proc.ExitCode)"
if ($exitCode -eq 0)
Expand All @@ -47,7 +47,14 @@ function Wait-VSInstallerProcesses
}
else
{
Write-Debug "$($proc.Name) process $($proc.Id) exited with code $($proc.ExitCode)"
if ($proc.ExitCode -ne $null)
{
Write-Debug "$($proc.Name) process $($proc.Id) exited with code $($proc.ExitCode)"
}
else
{
Write-Debug "$($proc.Name) process $($proc.Id) exited, exit code unknown"
}
}
}
}
Expand Down Expand Up @@ -89,17 +96,24 @@ function Wait-VSInstallerProcesses
{
$exitCode = $proc.ExitCode
}
if ($proc.ExitCode -ne 0)
if ($proc.ExitCode -ne 0 -and $proc.ExitCode -ne $null)
{
Write-Warning "vs_installer.windows.exe process $($proc.Id) exited with code $($proc.ExitCode)"
Write-Warning "$($proc.Name) process $($proc.Id) exited with code $($proc.ExitCode)"
if ($exitCode -eq 0)
{
$exitCode = $proc.ExitCode
}
}
else
{
Write-Debug "vs_installer.windows.exe process $($proc.Id) exited with code $($proc.ExitCode)"
if ($proc.ExitCode -ne $null)
{
Write-Debug "$($proc.Name) process $($proc.Id) exited with code $($proc.ExitCode)"
}
else
{
Write-Debug "$($proc.Name) process $($proc.Id) exited, exit code unknown"
}
}
}
}
Expand Down

0 comments on commit 8a72da5

Please sign in to comment.