aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/common/windows
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-03-17 21:43:11 +0100
committerLiang Qi <liang.qi@qt.io>2019-03-17 21:43:11 +0100
commit4978e6f835ef8778244e259bfa22c2e10450e9d5 (patch)
treec8d2e03abf4ab682b6a3524bad39cc55b6eb634b /coin/provisioning/common/windows
parent5df387f9248bd1a1d3e0681c073a80de097f1341 (diff)
parent48ab1d879bc5dc1f65ee6671e546f58ae1c67bee (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts: coin/provisioning/common/windows/helpers.ps1 Change-Id: If35fe38af7b7b1c4bba5009180fe51f37a90aa5c
Diffstat (limited to 'coin/provisioning/common/windows')
-rw-r--r--coin/provisioning/common/windows/disable-defragment.ps142
-rw-r--r--coin/provisioning/common/windows/helpers.ps119
-rw-r--r--coin/provisioning/common/windows/squishInstall.ps131
-rw-r--r--coin/provisioning/common/windows/vc_redist.ps13
4 files changed, 78 insertions, 17 deletions
diff --git a/coin/provisioning/common/windows/disable-defragment.ps1 b/coin/provisioning/common/windows/disable-defragment.ps1
index 876938f8..e76f0649 100644
--- a/coin/provisioning/common/windows/disable-defragment.ps1
+++ b/coin/provisioning/common/windows/disable-defragment.ps1
@@ -1,6 +1,6 @@
#############################################################################
##
-## Copyright (C) 2018 The Qt Company Ltd.
+## Copyright (C) 2019 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing/
##
## This file is part of the provisioning scripts of the Qt Toolkit.
@@ -31,4 +31,42 @@
##
#############################################################################
-schtasks /Delete /TN "\Microsoft\Windows\Defrag\ScheduledDefrag" /F
+# Windows 7 does not have Get-ScheduledTask and Unregister-ScheduledTask
+# thus needing its own version.
+Write-Host "Disabling defragmentation"
+$version = Get-CimInstance Win32_OperatingSystem | Select-Object -ExpandProperty Caption
+if ($version -like '*Windows 7*'){
+ $pi = New-Object System.Diagnostics.ProcessStartInfo
+ $pi.FileName = "C:\Windows\System32\schtasks.exe"
+ $pi.RedirectStandardError = $true
+ $pi.UseShellExecute = $false
+ $pi.Arguments = "/Delete /TN `"\Microsoft\Windows\Defrag\ScheduledDefrag`" /F"
+ $prog = New-Object System.Diagnostics.Process
+ $prog.StartInfo = $pi
+ $prog.Start() | Out-Null
+ $err = $prog.StandardError.ReadToEnd()
+ $prog.WaitForExit()
+ if ($prog.ExitCode -eq 0){
+ Write-Host "Scheduled defragmentation removed"
+ } else {
+ if ($err -like '*cannot find the file*'){
+ Write-Host "No scheduled defragmentation task found"
+ exit 0
+ } else {
+ Write-Host "Error while deleting scheduled defragmentation task: $err"
+ }
+ }
+}
+else {
+ try {
+ $state = (Get-ScheduledTask -ErrorAction Stop -TaskName "ScheduledDefrag").State
+ Write-Host "Scheduled defragmentation task found in state: $state"
+ }
+ catch {
+ Write-Host "No scheduled defragmentation task found"
+ exit 0
+ }
+ Write-Host "Unregistering scheduled defragmentation task"
+ Unregister-ScheduledTask -ErrorAction Stop -Confirm:$false -TaskName ScheduledDefrag
+ Write-Host "Scheduled Defragmentation task was cancelled"
+}
diff --git a/coin/provisioning/common/windows/helpers.ps1 b/coin/provisioning/common/windows/helpers.ps1
index 9cd8567e..5a7eb674 100644
--- a/coin/provisioning/common/windows/helpers.ps1
+++ b/coin/provisioning/common/windows/helpers.ps1
@@ -191,3 +191,22 @@ function Retry{
Throw("Failed to run command successfully in $retry_count tries")
}
}
+
+function Remove {
+
+ Param (
+ [string]$Path = $(BadParam("a path"))
+ )
+ Write-Host "Removing $Path"
+ $i = 0
+ While ( Test-Path($Path) ){
+ Try{
+ remove-item -Force -Recurse -Path $Path -ErrorAction Stop
+ }catch{
+ $i +=1
+ if ($i -eq 5) {exit 1}
+ Write-Verbose "$Path locked, trying again in 5"
+ Start-Sleep -seconds 5
+ }
+ }
+}
diff --git a/coin/provisioning/common/windows/squishInstall.ps1 b/coin/provisioning/common/windows/squishInstall.ps1
index 5fb032f5..de04d242 100644
--- a/coin/provisioning/common/windows/squishInstall.ps1
+++ b/coin/provisioning/common/windows/squishInstall.ps1
@@ -38,18 +38,18 @@
# NOTE! Make sure 64bit versions are always installed before 32bit,
# because they use same folder name before a rename
-$version = "6.3.2"
+$version = "6.4.3"
# Qt branch without dot (*.*)
-$qtBranch = "510x"
-# So far Squish built with Qt5.10 works also with 5.11, but we have to be prepared that on some point
+$qtBranch = "512x"
+# So far Squish built with Qt5.12 works also with 5.13, but we have to be prepared that on some point
# the compatibility breaks, and we may need to have separate Squish packages for different Qt versions.
$targetDir = "C:\Utils\squish"
$squishUrl = "\\ci-files01-hki.intra.qt.io\provisioning\squish\coin"
$squishBranchUrl = "$squishUrl\$qtBranch"
$testSuite = "suite_test_squish"
-$testSuiteUrl = "\\ci-files01-hki.intra.qt.io\provisioning\squish\coin\$testSuite.7z"
+$testSuiteUrl = "$squishUrl\$testSuite.7z"
# Squish license
$licensePackage = ".squish-3-license"
@@ -62,7 +62,10 @@ Function DownloadAndInstallSquish {
[string]$bit,
[string]$squishPackage
)
-
+ # MinGW x86 available only with Qt5.11, to be updated when Squish is supporting 5.13
+ if ("$bit" -eq "win32" -and $squishPackage.StartsWith("mingw")) {
+ $qtBranch = "511x"
+ }
$SquishUrl = $squishBranchUrl + "\squish-" + $version + "-qt" + $qtBranch + "-" + $bit + "-" + $squishPackage + ".exe"
$SquishInstaller = "$targetDir\$squishPackage.exe"
$SquishParameters = "unattended=1 targetdir=$targetDir\$squishPackage"
@@ -125,25 +128,27 @@ DownloadSquishLicence $squishUrl
if ($OSVersion -eq "Windows 10 Enterprise") {
if (Is64BitWinHost) {
- DownloadAndInstallSquish $version win64 msvc14
+ DownloadAndInstallSquish $version win64 "msvc14"
+ DownloadAndInstallSquish $version win64 "msvc141"
+ DownloadAndInstallSquish $version win64 "mingw_gcc73_posix_seh"
+ } else {
+ DownloadAndInstallSquish $version win32 "mingw_gcc53_posix_dwarf"
}
- DownloadAndInstallSquish $version win32 "mingw_gcc53_posix_dwarf"
- DownloadAndInstallSquish $version win32 "msvc14"
+ DownloadAndInstallSquish $version win32 "msvc141"
} elseif ($OSVersion -eq "Windows 8.1 Enterprise") {
if (Is64BitWinHost) {
- DownloadAndInstallSquish $version win64 "msvc12"
DownloadAndInstallSquish $version win64 "msvc14"
}
- DownloadAndInstallSquish $version win32 "msvc14"
+ DownloadAndInstallSquish $version win32 "msvc141"
} elseif ($OSVersion -eq "Windows 7 Enterprise") {
if (Is64BitWinHost) {
- DownloadAndInstallSquish $version win64 "msvc12"
DownloadAndInstallSquish $version win64 "msvc14"
+ } else {
+ DownloadAndInstallSquish $version win32 "mingw_gcc53_posix_dwarf"
}
- DownloadAndInstallSquish $version win32 "mingw_gcc53_posix_dwarf"
- DownloadAndInstallSquish $version win32 "msvc14"
+ DownloadAndInstallSquish $version win32 "msvc141"
}
diff --git a/coin/provisioning/common/windows/vc_redist.ps1 b/coin/provisioning/common/windows/vc_redist.ps1
index f68846f0..1cd81a37 100644
--- a/coin/provisioning/common/windows/vc_redist.ps1
+++ b/coin/provisioning/common/windows/vc_redist.ps1
@@ -57,5 +57,4 @@ Download $externalUrl $internalUrl $package
Verify-Checksum $package $sha1
Write-Host "Installing $package..."
Run-Executable $package "/q"
-Write-Host "Remove $package..."
-Remove-Item -Force -Path $package
+Remove $package