forked from WebKitForWindows/WebKitRequirements
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGet-CFLite.ps1
28 lines (21 loc) · 923 Bytes
/
Get-CFLite.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<#
.Synopsis
Gets the CFLite requirement.
.Details
Downloads the CFLite distribution.
.Parameter Root
The root directory to download source to. Defaults to current directory.
#>
Param(
[string] $root = '.'
)
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;
$url = 'https://github.com/WebKitForWindows/WinCairoRequirements/releases/download/cflitev2017.04.05/CFLite.zip';
$extension = [System.IO.Path]::GetExtension($url);
$fileName = [System.IO.Path]::GetTempFileName() | Rename-Item -NewName { $_ -replace '.tmp$', $extension } -PassThru;
Write-Host ('Downloading CFLite distribution from {0} ...' -f $url);
Write-Host $fileName;
(New-Object System.Net.WebClient).DownloadFile($url, $fileName);
Write-Host ('Downloaded {0} bytes' -f (Get-Item $fileName).Length);
Expand-7Zip -ArchiveFileName $fileName -TargetPath $root;
Remove-Item $fileName -Force;