Set 'SecurityProtocol' to 'Tls12' for download dependencies on windows

But only for dependencies downloaded from github.
This commit is contained in:
abcdefg30
2018-02-25 18:05:01 +01:00
committed by abcdefg30
parent 4376dd8c52
commit 851c38012e

View File

@@ -122,6 +122,23 @@ if (!(Test-Path "FuzzyLogicLibrary.dll"))
rmdir FuzzyLogicLibrary -Recurse
}
if (!(Test-Path "rix0rrr.BeaconLib.dll"))
{
echo "Fetching rix0rrr.BeaconLib from NuGet."
./nuget.exe install rix0rrr.BeaconLib -Version 1.0.1 -ExcludeVersion -Verbosity quiet
cp rix0rrr.BeaconLib/lib/net40/rix0rrr.BeaconLib.dll .
rmdir rix0rrr.BeaconLib -Recurse
}
if (!(Test-Path "GeoLite2-Country.mmdb.gz") -Or (((get-date) - (get-item "GeoLite2-Country.mmdb.gz").LastWriteTime) -gt (new-timespan -days 30)))
{
echo "Updating GeoIP country database from MaxMind."
$target = Join-Path $pwd.ToString() "GeoLite2-Country.mmdb.gz"
(New-Object System.Net.WebClient).DownloadFile("http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz", $target)
}
[Net.ServicePointManager]::SecurityProtocol = 'Tls12'
if (!(Test-Path "SDL2-CS.dll"))
{
echo "Fetching SDL2-CS from GitHub."
@@ -143,19 +160,4 @@ if (!(Test-Path "Eluant.dll"))
(New-Object System.Net.WebClient).DownloadFile("https://github.com/OpenRA/Eluant/releases/download/20160124/Eluant.dll", $target)
}
if (!(Test-Path "GeoLite2-Country.mmdb.gz") -Or (((get-date) - (get-item "GeoLite2-Country.mmdb.gz").LastWriteTime) -gt (new-timespan -days 30)))
{
echo "Updating GeoIP country database from MaxMind."
$target = Join-Path $pwd.ToString() "GeoLite2-Country.mmdb.gz"
(New-Object System.Net.WebClient).DownloadFile("http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz", $target)
}
if (!(Test-Path "rix0rrr.BeaconLib.dll"))
{
echo "Fetching rix0rrr.BeaconLib from NuGet."
./nuget.exe install rix0rrr.BeaconLib -Version 1.0.1 -ExcludeVersion -Verbosity quiet
cp rix0rrr.BeaconLib/lib/net40/rix0rrr.BeaconLib.dll .
rmdir rix0rrr.BeaconLib -Recurse
}
cd ..