Split Common folder based on operating system families
[mirror/qt/qt5.git] / coin / provisioning / common / windows / install-mingw.ps1
1 function InstallMinGW
2 {
3     Param (
4         [string] $version     = $(BadParam("the version being printed to versions.txt")),
5         [string] $release     = $(BadParam("release part of the file name"))
6     )
7
8     $envvar = "MINGW$version"
9     $envvar = $envvar -replace '["."]'
10     $targetdir = "C:\$envvar"
11     $url_cache = "\\ci-files01-hki.intra.qt.io\provisioning\windows\i686-" + $version + "-" + $release + ".7z"
12
13     $mingwPackage = "C:\Windows\Temp\MinGW-$version.zip"
14     Copy-Item $url_cache $mingwPackage
15
16     Get-ChildItem $mingwPackage | % {& "C:\Utils\sevenzip\7z.exe" "x" $_.fullname "-o$TARGETDIR"}
17
18     echo "Adding MinGW environment variable."
19     [Environment]::SetEnvironmentVariable("$envvar", "$targetdir\mingw32", [EnvironmentVariableTarget]::Machine)
20
21     echo "Cleaning $mingwPackage.."
22     Remove-Item -Recurse -Force "$mingwPackage"
23
24     echo "MinGW = $version $release" >> ~\versions.txt
25
26 }