Skip to content

Commit

Permalink
Validation of status of installation when Start-Process PowerShell co…
Browse files Browse the repository at this point in the history
…mmandlet is used
  • Loading branch information
mabrarov committed Aug 20, 2019
1 parent ad39bd6 commit f544266
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Expand Up @@ -9,7 +9,7 @@ install:
- ps: .\install.ps1

build_script:
- ps: Write-Host "Skipping due to exhausted quotas"
- ps: Write-Warning "Skipping due to exhausted quotas"
#- ps: .\build.ps1

test_script:
Expand Down
7 changes: 5 additions & 2 deletions docker/msvc-2017/app/install.ps1
Expand Up @@ -18,7 +18,7 @@ Write-Host "Downloading Visual Studio 2017 Community edition from ${msvs_url} in

# Install Visual C++ part of Visual Studio 2017 Community edition
Write-Host "Installing Visual C++ part of Visual Studio 2017 Community edition with support of Desktop applications and MFC"
Start-Process -FilePath "${msvs_dist}" -ArgumentList `
$p = Start-Process -FilePath "${msvs_dist}" -ArgumentList `
("--locale en-US", `
"--quiet", `
"--norestart", `
Expand All @@ -27,7 +27,10 @@ Start-Process -FilePath "${msvs_dist}" -ArgumentList `
"--add Microsoft.VisualStudio.Workload.NativeDesktop", `
"--add Microsoft.VisualStudio.Component.VC.ATLMFC", `
"--includeRecommended") `
-Wait
-Wait -PassThru
if (${p.ExitCode} -ne 0) {
throw "Failed to install Visual Studio 2017 Community edition with exit code ${p.ExitCode}"
}
Write-Host "Visual C++ part of Visual Studio 2017 (${env:MSVS_VERSION}) installed"

# Download and install Visual Studio Locator
Expand Down
20 changes: 16 additions & 4 deletions docker/win-builder/app/install.ps1
Expand Up @@ -25,9 +25,12 @@ if (-not (Test-Path -Path "${seven_zip_dist}")) {
(New-Object System.Net.WebClient).DownloadFile("${seven_zip_url}", "${seven_zip_dist_name}")
}
Write-Host "Installing 7-Zip from ${seven_zip_dist} into ${env:SEVEN_ZIP_HOME}"
Start-Process -FilePath msiexec `
$p = Start-Process -FilePath msiexec `
-ArgumentList ("/package", "${seven_zip_dist}", "/quiet", "/qn", "/norestart") `
-Wait
if (${p.ExitCode} -ne 0) {
throw "Failed to install 7-Zip with exit code ${p.ExitCode}"
}
Write-Host "7-Zip ${env:SEVEN_ZIP_VERSION} installed"

# Download and install MSYS2
Expand All @@ -47,9 +50,12 @@ $active_perl_dist = "${env:TMP}\${active_perl_dist_name}"
Write-Host "Downloading ActivePerl from ${active_perl_url} into ${active_perl_dist}"
(New-Object System.Net.WebClient).DownloadFile("${active_perl_url}", "${active_perl_dist}")
Write-Host "Installing ActivePerl from ${active_perl_dist} into ${env:ACTIVE_PERL_HOME}"
Start-Process -FilePath "${active_perl_dist}" `
$p = Start-Process -FilePath "${active_perl_dist}" `
-ArgumentList ("/exenoui", "/norestart", "/quiet", "/qn", "TargetDir=""${env:ACTIVE_PERL_HOME}""") `
-Wait
if (${p.ExitCode} -ne 0) {
throw "Failed to install ActivePerl with exit code ${p.ExitCode}"
}
Write-Host "ActivePerl ${env:ACTIVE_PERL_VERSION} installed"

# Download and install Python 2.x
Expand All @@ -59,9 +65,12 @@ $python_dist = "${env:TMP}\${python_dist_name}"
Write-Host "Downloading Python ${env:PYTHON2_VERSION} from ${python_dist_url} into ${python_dist}"
(New-Object System.Net.WebClient).DownloadFile("${python_dist_url}", "${python_dist}")
Write-Host "Installing Python ${env:PYTHON2_VERSION} from ${python_dist} into ${env:PYTHON2_HOME}"
Start-Process -FilePath "${python_dist}" `
$p = Start-Process -FilePath "${python_dist}" `
-ArgumentList ("/norestart", "/quiet", "/qn", "ALLUSERS=1", "TargetDir=""${env:PYTHON2_HOME}""") `
-Wait
if (${p.ExitCode} -ne 0) {
throw "Failed to install Python ${env:PYTHON2_VERSION} with exit code ${p.ExitCode}"
}
Write-Host "Python ${env:PYTHON2_VERSION} installed"

# Download and install Python 3.x
Expand All @@ -71,9 +80,12 @@ $python_dist = "${env:TMP}\${python_dist_name}"
Write-Host "Downloading Python ${env:PYTHON3_VERSION} from ${python_dist_url} into ${python_dist}"
(New-Object System.Net.WebClient).DownloadFile("${python_dist_url}", "${python_dist}")
Write-Host "Installing Python ${env:PYTHON3_VERSION} from ${python_dist} into ${env:PYTHON3_HOME}"
Start-Process -FilePath "${python_dist}" `
$p = Start-Process -FilePath "${python_dist}" `
-ArgumentList ("/exenoui", "/norestart", "/quiet", "/qn", "InstallAllUsers=1", "TargetDir=""${env:PYTHON3_HOME}""") `
-Wait
if (${p.ExitCode} -ne 0) {
throw "Failed to install Python ${env:PYTHON3_VERSION} with exit code ${p.ExitCode}"
}
Write-Host "Python ${env:PYTHON3_VERSION} installed"

# Cleanup
Expand Down

0 comments on commit f544266

Please sign in to comment.