aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/common/windows
diff options
context:
space:
mode:
Diffstat (limited to 'coin/provisioning/common/windows')
-rw-r--r--coin/provisioning/common/windows/android-openssl.ps12
-rw-r--r--coin/provisioning/common/windows/android.ps14
-rw-r--r--coin/provisioning/common/windows/disable-schedule-tasks.ps188
-rw-r--r--coin/provisioning/common/windows/disable-update-orchestrator.ps116
-rw-r--r--coin/provisioning/common/windows/disable-windows-file-protector.ps14
-rw-r--r--coin/provisioning/common/windows/disable-windows-update-medic.ps125
-rw-r--r--coin/provisioning/common/windows/disable-windows-updates.ps14
-rw-r--r--coin/provisioning/common/windows/helpers.ps132
8 files changed, 38 insertions, 137 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-schedule-tasks.ps1 b/coin/provisioning/common/windows/disable-schedule-tasks.ps1
deleted file mode 100644
index 351f10c6..00000000
--- a/coin/provisioning/common/windows/disable-schedule-tasks.ps1
+++ /dev/null
@@ -1,88 +0,0 @@
-. "$PSScriptRoot\helpers.ps1"
-
-# This script will remove unneeded Tasks from Task Scheduler
-
-# Application Experience 'Microsoft Compatibility Appraiser' - "Collects program telemetry information if opted-in to the Microsoft Customer Experience Improvement Program."
-DisableSchedulerTask "Application Experience\Microsoft Compatibility Appraiser"
-
-# Application Experience 'ProgramDataUpdater' - "Collects program telemetry information if opted-in to the Microsoft Customer Experience Improvement Program"
-DisableSchedulerTask "Application Experience\ProgramDataUpdater"
-
-# Autochk 'Proxy' - "This task collects and uploads autochk SQM data if opted-in to the Microsoft Customer Experience Improvement Program."
-DisableSchedulerTask "Autochk\Proxy"
-
-# Chkdsk 'ProactiveScan' - "NTFS Volume Health Scan"
-DisableSchedulerTask "Chkdsk\ProactiveScan"
-
-# Chkdsk 'SyspartRepair'
-DeleteSchedulerTask "Chkdsk\SyspartRepair"
-
-# Customer Experience Improvement Program 'Consolidator' - "If the user has consented to participate in the Windows Customer Experience Improvement Program, this job collects and sends usage data to Microsoft."
-DisableSchedulerTask "Customer Experience Improvement Program\Consolidator"
-
-# Customer Experience Improvement Program 'sbCeip' - "The USB CEIP (Customer Experience Improvement Program) task collects Universal Serial Bus related statistics and information about your machine and sends it to the Windows Device Connectivity engineering group at Microsoft. The information received is used to help improve the reliability, stability, and overall functionality of USB in Windows. If the user has not consented to participate in Windows CEIP, this task does not do anything."
-DisableSchedulerTask "Customer Experience Improvement Program\UsbCeip"
-
-# Device Information 'Device'
-DisableSchedulerTask "Device Information\Device"
-
-# Diagnosis 'Scheduled' - "The Windows Scheduled Maintenance Task performs periodic maintenance of the computer system by fixing problems automatically or reporting them through Security and Maintenance."
-DisableSchedulerTask "Diagnosis\Scheduled"
-
-# DiskDiagnostic 'Microsoft-Windows-DiskDiagnosticDataCollector' - "The Windows Disk Diagnostic reports general disk and system information to Microsoft for users participating in the Customer Experience Program."
-DisableSchedulerTask "DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector"
-
-# ExploitGuard 'ExploitGuard MDM policy Refresh' - "Task for applying changes to the machine's Exploit Protection settings."
-DisableSchedulerTask "ExploitGuard\ExploitGuard MDM policy Refresh"
-
-# Feedback/Siuf 'DmClient'
-DisableSchedulerTask "Feedback\Siuf\DmClient"
-
-# Feedback/Siuf 'DmClient'OnScenarioDownload'
-DisableSchedulerTask "Feedback\Siuf\DmClientOnScenarioDownload"
-
-# File Classification Infrastructure 'Property Definition Sync'
-DisableSchedulerTask "File Classification Infrastructure\Property Definition Sync"
-
-# InstallService 'ScanForUpdates'
-DisableSchedulerTask "InstallService\ScanForUpdates"
-
-# InstallService 'ScanForUpdatesAsUser'
-DisableSchedulerTask "InstallService\ScanForUpdatesAsUser"
-
-# LanguageComponentsInstaller 'Installation' - "Install language components that match the user's language list."
-DisableSchedulerTask "LanguageComponentsInstaller\Installation"
-
-# LanguageComponentsInstaller 'ReconcileLanguageResources' - "Install language components that match the user's language list."
-DisableSchedulerTask "LanguageComponentsInstaller\ReconcileLanguageResources"
-
-# PI 'Secure-Boot-Update' - "This task updates the Secure Boot variables."
-DisableSchedulerTask "PI\Secure-Boot-Update"
-
-# PI 'Sqm-Tasks' - "This task gathers information about the Trusted Platform Module (TPM), Secure Boot, and Measured Boot."
-DisableSchedulerTask "PI\Sqm-Tasks"
-
-# Power Efficiency Diagnotics 'AnalyzeSystem' - "This task analyzes the system looking for conditions that may cause high energy use."
-DisableSchedulerTask "PushToInstall\Registration"
-
-# Servicing 'StartComponentCleanup'
-DisableSchedulerTask "Servicing\StartComponentCleanup"
-
-# SettingSync 'BackgroundUploadTask'
-DeleteSchedulerTask "SettingSync\BackgroundUploadTask"
-
-# SoftwareProtectionPlatform 'SvcRestartTask' - "This task restarts the Software Protection Platform service at the specified time"
-DeleteSchedulerTask "SoftwareProtectionPlatform\SvcRestartTask"
-
-# SoftwareProtectionPlatform 'SvcRestartTaskLogon' - "This task restarts the Software Protection Platform service at the specified time"
-DisableSchedulerTask "SoftwareProtectionPlatform\SvcRestartTaskLogon"
-
-# SoftwareProtectionPlatform 'SvcRestartTaskNetwork' - "This task restarts the Software Protection Platform service when a new network is detected"
-DisableSchedulerTask "SoftwareProtectionPlatform\SvcRestartTaskNetwork"
-
-# UNP 'RunUpdateNotificationMgr'
-DeleteSchedulerTask "UNP\RunUpdateNotificationMgr"
-
-
-
-
diff --git a/coin/provisioning/common/windows/disable-update-orchestrator.ps1 b/coin/provisioning/common/windows/disable-update-orchestrator.ps1
deleted file mode 100644
index 5ae8fb0d..00000000
--- a/coin/provisioning/common/windows/disable-update-orchestrator.ps1
+++ /dev/null
@@ -1,16 +0,0 @@
-# Disable UpdateOrchestrator
-
-$name = "UpdateOrchestrator"
-$path = "C:\Windows\System32\Tasks\Microsoft\Windows\$name"
-
-takeown /F $path /A /R
-icacls $path /grant Administrators:F /T
-SCHTASKS /Change /TN "Microsoft\Windows\$name\Reboot" /DISABLE
-del "$path\Schedule Scan"
-del "$path\Schedule Scan Static Task"
-del "$path\Backup Scan"
-del "$path\UpdateModelTask"
-del "$path\USO_UxBroker"
-
-# Disable Update orchestrator service
-reg.exe ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsoSvc" /V Start /T REG_dWORD /D 4 /F
diff --git a/coin/provisioning/common/windows/disable-windows-file-protector.ps1 b/coin/provisioning/common/windows/disable-windows-file-protector.ps1
deleted file mode 100644
index f1d09fb5..00000000
--- a/coin/provisioning/common/windows/disable-windows-file-protector.ps1
+++ /dev/null
@@ -1,4 +0,0 @@
-# Disable Windows File Protection
-# Windows File Protection feature in Microsoft Windows prevents programs from replacing critical Windows system files.
-
-reg.exe ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /V SFCDisable /T REG_dWORD /D 0xffffff9d /F
diff --git a/coin/provisioning/common/windows/disable-windows-update-medic.ps1 b/coin/provisioning/common/windows/disable-windows-update-medic.ps1
deleted file mode 100644
index 6accbd3b..00000000
--- a/coin/provisioning/common/windows/disable-windows-update-medic.ps1
+++ /dev/null
@@ -1,25 +0,0 @@
-# Windows Update Medic Service (WaaSMedicSvc)'PerformRemediation' helps recover update-related services to the supported configuration.
-# WaasMedicSvc keeps re-starting Windows Update, even if it disabled manually.
-# Even Admin user don't have privileged to disable PerformRemediation from Task Scheduler which means that WaaSMedicSvc.dll need's to be removed from the system
-
-$limit = (Get-Date).AddMinutes(20)
-$path = "C:\Windows\System32\WaaSMedicSvc.dll"
-
-DO {
- takeown /F $path
- icacls $path /grant Administrators:f
- Write-host "Deleting $path"
-
- Try {
- del $path
- }
- Catch [System.UnauthorizedAccessException] {
- Write-host "Access to the path '$path' is denied."
- Continue
- }
-
- if ((Get-Date) -gt $limit) {
- exit 1
- }
-
-}while (Test-Path -Path "$path")
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 (