diff options
author | Oliver Wolff <oliver.wolff@qt.io> | 2018-02-14 07:46:11 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-02-26 19:52:45 +0000 |
commit | cb6709ce5c48a31ba1170c71494c1a3869ffa5bb (patch) | |
tree | 8fdb8721a71cba868c2fbfe7c9fbc237d1f990a8 /coin/provisioning/common/windows/install-strawberry-perl.ps1 | |
parent | 08c88de5c8d531fb4fee03a0c337dd93739d365a (diff) |
Unify Windows provisioning scripts & improve error handlingv5.11.0-beta1
While Coin should also see exit codes != 0 as error, we should
stick to one way of handling script errors. As Power Shell cmdlets
signal an error by throwing an exception we should do the same
(and that approach also works in Coin).
Additionally extracting 7zip files was unified across scripts by
using the existing helper function instead of reinventing the wheel
again and again.
A similar helper function was introduced for starting an external
application (and handling its errors).
Also echo and other "cmd" commands were replaced by their PowerShell
equivalents to have a unified approach across our Windows provisioning
scripts.
Change-Id: I70129ce38692f1396c33c13b33a2918485fa5271
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'coin/provisioning/common/windows/install-strawberry-perl.ps1')
-rw-r--r-- | coin/provisioning/common/windows/install-strawberry-perl.ps1 | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/coin/provisioning/common/windows/install-strawberry-perl.ps1 b/coin/provisioning/common/windows/install-strawberry-perl.ps1 index 8b4a4a25..c80f16a4 100644 --- a/coin/provisioning/common/windows/install-strawberry-perl.ps1 +++ b/coin/provisioning/common/windows/install-strawberry-perl.ps1 @@ -36,23 +36,23 @@ # This script installs Strawberry Perl $version = "5.26.0.1" -if( (is64bitWinHost) -eq 1 ) { +if (Is64BitWinHost) { $arch = "-64bit" $sha1 = "2AE2EDA36A190701399130CBFEE04D00E9BA036D" -} -else { +} else { $arch = "-32bit" $sha1 = "b50b688a879f33941433774b2813bfd4b917e4ee" } -$url_cache = "\\ci-files01-hki.intra.qt.io\provisioning\windows\strawberry-perl-" + $version + $arch + ".msi" -$url_official = "http://strawberryperl.com/download/" + $version + "/strawberry-perl-" + $version + $arch + ".msi" -$strawberryPackage = "C:\Windows\Temp\strawberry-installer-$version.msi" +$installer_name = "strawberry-perl-" + $version + $arch + ".msi" +$url_cache = "\\ci-files01-hki.intra.qt.io\provisioning\windows\" + $installer_name +$url_official = "http://strawberryperl.com/download/" + $version + "/" + $installer_name +$strawberryPackage = "C:\Windows\Temp\" + $installer_name Download $url_official $url_cache $strawberryPackage Verify-Checksum $strawberryPackage $sha1 -cmd /c "$strawberryPackage /QB INSTALLDIR=C:\strawberry REBOOT=REALLYSUPPRESS" +Run-Executable "$strawberryPackage" "/QB INSTALLDIR=C:\strawberry REBOOT=REALLYSUPPRESS" -echo "Cleaning $strawberryPackage.." -Remove-Item -Recurse -Force "$strawberryPackage" +Write-Host "Cleaning $strawberryPackage.." +Remove-Item -Recurse -Force -Path "$strawberryPackage" -echo "strawberry = $version" >> ~\versions.txt +Write-Output "strawberry = $version" >> ~\versions.txt |