Commit 704b3b70 authored by Alexey.Golubev's avatar Alexey.Golubev

update cef if newer version exist

parent e4674915
Add-Type -AssemblyName System.IO.Compression.FileSystem
# ----------------------------------------------------------------------------------------------
# download a file
# ----------------------------------------------------------------------------------------------
function Download-File
{
param ([string]$url,[string]$file)
$downloadRequired = $true
if (Test-Path $file)
{
$localModified = (Get-Item $file).LastWriteTime
$webRequest = [System.Net.HttpWebRequest]::Create($url)
$webRequest.Method = "HEAD"
$webResponse = $webRequest.GetResponse()
$remoteLastModified = ($webResponse.LastModified) -as [DateTime]
$webResponse.Close()
if ($remoteLastModified -gt $localModified)
{
Write-Host "$file is out of date"
}
else
{
$downloadRequired = $false
}
}
if ($downloadRequired)
{
$clnt = new-object System.Net.WebClient
Write-Host "Downloading from $url to $file"
$clnt.DownloadFile($url, $file)
}
else
{
Write-Host "$file is up to date."
}
return $downloadRequired
}
# ----------------------------------------------------------------------------------------------
# unzip a file
# ----------------------------------------------------------------------------------------------
function RemoveCef
{
param([string]$outpath)
if (Test-Path $outpath)
{
Write-Host "Remove folder $outpath"
Remove-Item $outpath -Force -Recurse
}
}
$output = Download-File -url $args[0] -file $args[1]
if ($output)
{
RemoveCef -outpath $args[2]
}
\ No newline at end of file
......@@ -12,11 +12,7 @@ if defined TARGET (
mkdir "%SCRIPTPATH%%PLATFORM%"
cd "%SCRIPTPATH%%PLATFORM%"
if exist "cef_binary.7z" (
echo "cef_binary.7z already downloaded"
) else (
Powershell.exe Invoke-WebRequest -OutFile cef_binary.7z http://d2ettrnqo7v976.cloudfront.net/cef/3163/%PLATFORM%/cef_binary.7z
)
Powershell.exe -executionpolicy remotesigned -file %SCRIPTPATH%download.ps1 http://d2ettrnqo7v976.cloudfront.net/cef/3163/%PLATFORM%/cef_binary.7z cef_binary.7z cef_binary
SET UNSIP_PROGRAMM="%ProgramFiles%\7-Zip\7z.exe"
SET UNSIP_PROGRAMM2="%ProgramFiles(x86)%\7-Zip\7z.exe"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment