aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/common/windows/install-msys2.ps1
diff options
context:
space:
mode:
Diffstat (limited to 'coin/provisioning/common/windows/install-msys2.ps1')
-rw-r--r--coin/provisioning/common/windows/install-msys2.ps124
1 files changed, 15 insertions, 9 deletions
diff --git a/coin/provisioning/common/windows/install-msys2.ps1 b/coin/provisioning/common/windows/install-msys2.ps1
index e88c8f07..784b09dc 100644
--- a/coin/provisioning/common/windows/install-msys2.ps1
+++ b/coin/provisioning/common/windows/install-msys2.ps1
@@ -1,6 +1,6 @@
############################################################################
##
-## Copyright (C) 2019 The Qt Company Ltd.
+## Copyright (C) 2020 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing/
##
## This file is part of the provisioning scripts of the Qt Toolkit.
@@ -33,6 +33,8 @@
. "$PSScriptRoot\helpers.ps1"
+# This script installs 7-Zip
+
$version = "20181211"
$prog = "msys2"
if (Is64BitWinHost) {
@@ -56,17 +58,21 @@ $TargetLocation = "C:\Utils"
Download $url_official $url_cache $PackagePath
Verify-Checksum $PackagePath $sha1
Extract-tar_gz $PackagePath $TargetLocation
-$bash = "$TargetLocation\$folder\usr\bin\bash"
+$msys = "$TargetLocation\$folder\msys2_shell.cmd"
# install perl
-Run-Executable "$bash" "`"-l`" `"-c`" `"rm -rf /etc/pacman.d/gnupg;pacman-key --init;pacman-key --populate msys2;pacman -S --noconfirm perl make`""
-Run-Executable "$bash" "`"-l`" `"-c`" `"yes | cpan -i Text::Template Test::More`""
+# Run these without 'Run-Executable' function. When using the function the gpg-agent will lock the needed tmp*.tmp file.
+cmd /c "$msys `"-l`" `"-c`" `"rm -rf /etc/pacman.d/gnupg;pacman-key --init;pacman-key --populate msys2;pacman -S --noconfirm perl make`""
+Start-Sleep -s 30
+cmd /c "$msys `"-l`" `"-c`" `"cpan -i Text::Template Test::More`""
+
+# Sometimes gpg-agent won't get killed after the installation process. If that happens the provisioning will won't continue and it will hang until timeout. So we need make sure it will be killed.
+# Let's sleep for awhile and wait that msys installation is finished. Otherwise the installation might start up gpg-agent or dirmngr after the script has passed the killing process.
+Start-Sleep -s 180
+if (Get-Process -Name "gpg-agent" -ErrorAction SilentlyContinue) { Stop-Process -Force -Name gpg-agent }
+if (Get-Process -Name "dirmngr" -ErrorAction SilentlyContinue) { Stop-Process -Force -Name dirmngr }
Write-Host "Cleaning $PackagePath.."
Remove-Item -Recurse -Force -Path "$PackagePath"
-# pacman-key launches gpg-agent and dirmngr in the background, see https://github.com/Alexpux/MSYS2-pacman/issues/56
-Stop-Process -Name "gpg-agent" -ErrorAction Ignore
-Stop-Process -Name "dirmngr" -ErrorAction Ignore
-
-Write-Output "MSYS2 = $version" >> ~\versions.txt
+Write-Output "7-Zip = $version" >> ~\versions.txt