-
Notifications
You must be signed in to change notification settings - Fork 18
/
PackCurlNative.ps1
54 lines (43 loc) · 1.52 KB
/
PackCurlNative.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
function GetLibcurlArch($arch, $version)
{
Invoke-WebRequest `
"https://bintray.com/artifact/download/vszakats/generic/curl-$version-$arch-mingw.zip" `
-OutFile "curl-$arch-mingw.zip"
Expand-Archive -Path "curl-$arch-mingw.zip" -DestinationPath "."
Remove-Item "curl-$arch-mingw.zip"
if ($arch -eq "win32")
{
$libcurlDll = "libcurl.dll"
}
else
{
$libcurlDll = "libcurl-x64.dll"
}
Copy-Item -Path "curl-$version-$arch-mingw\bin\$libcurlDll" -Destination "$arch\libcurl.dll"
Copy-Item -Path "curl-$version-$arch-mingw\bin\*.crt" -Destination "$arch\"
Remove-Item -Recurse "curl-$version-$arch-mingw"
}
function GetOpensslArch($arch, $version)
{
Invoke-WebRequest `
"https://bintray.com/artifact/download/vszakats/generic/openssl-$version-$arch-mingw.zip" `
-OutFile "openssl-$arch-mingw.zip"
Expand-Archive -Path "openssl-$arch-mingw.zip" -DestinationPath "."
Remove-Item "openssl-$arch-mingw.zip"
Copy-Item -Path "openssl-$version-$arch-mingw\*.dll" -Destination "$arch\"
Remove-Item -Recurse "openssl-$version-$arch-mingw"
}
New-Item -Name win64 -ItemType "directory"
New-Item -Name win32 -ItemType "directory"
GetLibcurlArch win64 "7.69.1"
GetLibcurlArch win32 "7.69.1"
GetOpensslArch win64 "1.1.1f"
GetOpensslArch win32 "1.1.1f"
$compress = @{
Path = "win64", "win32"
CompressionLevel = "Optimal"
DestinationPath = "Resources.zip"
}
Compress-Archive @compress
Remove-Item -Recurse win64
Remove-Item -Recurse win32