diff options
Diffstat (limited to 'coin/provisioning/common/windows')
4 files changed, 38 insertions, 4 deletions
diff --git a/coin/provisioning/common/windows/android-openssl.ps1 b/coin/provisioning/common/windows/android-openssl.ps1 index e4306584..d1877b64 100644 --- a/coin/provisioning/common/windows/android-openssl.ps1 +++ b/coin/provisioning/common/windows/android-openssl.ps1 @@ -51,7 +51,7 @@ $sha1 = "056057782325134b76d1931c48f2c7e6595d7ef4" $destination = "C:\Utils\openssl-android-master" # msys unix style paths -$ndkPath = "/c/Utils/Android/android-ndk-r19c" +$ndkPath = "/c/Utils/Android/android-ndk-r20" $openssl_path = "/c/Utils/openssl-android-master" $cc_path = "$ndkPath/toolchains/llvm/prebuilt/windows-x86_64/bin" Download https://www.openssl.org/source/openssl-$version.tar.gz \\ci-files01-hki.intra.qt.io\provisioning\openssl\openssl-$version.tar.gz $zip diff --git a/coin/provisioning/common/windows/android.ps1 b/coin/provisioning/common/windows/android.ps1 index def09116..537e14a2 100644 --- a/coin/provisioning/common/windows/android.ps1 +++ b/coin/provisioning/common/windows/android.ps1 @@ -40,10 +40,10 @@ # That's why we need to use Andoid-21 API version in Qt 5.9. # NDK -$ndkVersion = "r19c" +$ndkVersion = "r20" $ndkCachedUrl = "\\ci-files01-hki.intra.qt.io\provisioning\android\android-ndk-$ndkVersion-windows-x86_64.zip" $ndkOfficialUrl = "https://dl.google.com/android/repository/android-ndk-$ndkVersion-windows-x86_64.zip" -$ndkChecksum = "c4cd8c0b6e7618ca0a871a5f24102e40c239f6a3" +$ndkChecksum = "36e1dc77fad08ad2498fb94b13ad8caf26bbd9df" $ndkFolder = "c:\Utils\Android\android-ndk-$ndkVersion" $ndkZip = "c:\Windows\Temp\android_ndk_$ndkVersion.zip" diff --git a/coin/provisioning/common/windows/disable-windows-updates.ps1 b/coin/provisioning/common/windows/disable-windows-updates.ps1 index 87414f03..15644cfe 100644 --- a/coin/provisioning/common/windows/disable-windows-updates.ps1 +++ b/coin/provisioning/common/windows/disable-windows-updates.ps1 @@ -33,6 +33,8 @@ # This script disables the automatic Windows updates +. "$PSScriptRoot\helpers.ps1" + $service = get-service wuauserv if (-not $service) { Write-Host "Windows Update service not found." @@ -43,7 +45,7 @@ if ($service.Status -eq "Stopped") { Write-Host "Windows Update service already stopped." } else { Write-Host "Stopping Windows Update service." - Stop-Service -Name "wuauserv" -Force + Retry {Stop-Service -Name "wuauserv" -Force} 20 5 } $startup = Get-WmiObject Win32_Service | Where-Object {$_.Name -eq "wuauserv"} | Select -ExpandProperty "StartMode" diff --git a/coin/provisioning/common/windows/helpers.ps1 b/coin/provisioning/common/windows/helpers.ps1 index 3ccb42ac..8599791d 100644 --- a/coin/provisioning/common/windows/helpers.ps1 +++ b/coin/provisioning/common/windows/helpers.ps1 @@ -204,6 +204,38 @@ function Get-Proxy { return (Get-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings').proxyServer } +function Retry{ + <# + usage: + Retry{CODE} + Retry{CODE} <num of retries> <delay_s> + #delay is in seconds + #> + Param( + [Parameter(mandatory=$true)] + [scriptblock]$command, + [int][ValidateRange(1, 20)]$retry = 5, + [int][ValidateRange(1, 60)]$delay_s = 5 + ) + $success=$false + $retry_count=0 + do{ + try { + Invoke-Command -ScriptBlock $command + $success=$true + } + catch { + $retry_count++ + Write-Host "Error: $_, try: $retry_count, retrying in $delay_s seconds" + Start-Sleep -Seconds $delay_s + } + } until ($success -or $retry+1 -le $retry_count) + + if (-not $success) { + Throw("Failed to run command successfully in $retry_count tries") + } +} + function Remove { Param ( |