diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2017-06-12 21:36:03 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2017-06-12 21:36:03 +0200 |
commit | 20113e48724e303e40f6930d44b0999e965ea67a (patch) | |
tree | 7499419f896dd1504fff531a1bee3a18dc289bfc /coin/provisioning/common/helpers.ps1 | |
parent | 9b0e908aca19d58a0d6b6eefebeb7e184437ada5 (diff) | |
parent | 5bc43f0cc3cfe047dcdbe2a293f4ed6885d8a637 (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.9
Conflicts:
coin/platform_configs/default.txt
coin/platform_configs/qt5.txt
Change-Id: I1709ddd14bf27186a8968ce073cf22e7903ff798
Diffstat (limited to 'coin/provisioning/common/helpers.ps1')
-rw-r--r-- | coin/provisioning/common/helpers.ps1 | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/coin/provisioning/common/helpers.ps1 b/coin/provisioning/common/helpers.ps1 index af7f79ff..1d624243 100644 --- a/coin/provisioning/common/helpers.ps1 +++ b/coin/provisioning/common/helpers.ps1 @@ -53,6 +53,32 @@ function Extract-Zip $destinationFolder.CopyHere($zipfile.Items(), 16) } +function Extract-Dev-Folders-From-Zip +{ + Param ( + [string]$package, + [string]$zipDir, + [string]$installPath + ) + + $shell = new-object -com shell.application + + echo "Extracting contents of $package" + foreach ($subDir in "lib", "include", "bin", "share") { + $zip = $shell.Namespace($package + "\" + $zipDir + "\" + $subDir) + if ($zip) { + Write-Host "Extracting $subDir from zip archive" + } else { + Write-Host "$subDir is missing from zip archive - skipping" + continue + } + $destDir = $installPath + "\" + $subdir + New-Item $destDir -type directory + $destinationFolder = $shell.Namespace($destDir) + $destinationFolder.CopyHere($zip.Items(), 16) + } +} + function BadParam { Param ([string]$Description) @@ -67,7 +93,11 @@ function Download [string] $Destination = $(BadParam("a download target location")) ) try { - Invoke-WebRequest -UseBasicParsing $CachedUrl -OutFile $Destination + if ($CachedUrl.StartsWith("http")) { + Invoke-WebRequest -UseBasicParsing $CachedUrl -OutFile $Destination + } else { + Copy-Item $CachedUrl $Destination + } } catch { Invoke-WebRequest -UseBasicParsing $OfficialUrl -OutFile $Destination } |