Compare commits

..

6 Commits

Author SHA1 Message Date
a0fd139027 Merge pull request #55 from ONLYOFFICE/feature/v5.0.7.1
Feature/v5.0.7.1
2017-12-06 18:54:01 +03:00
48852bc618 removed unused code 2017-12-06 18:51:58 +03:00
20b781cb7e pdf checker bug 2017-12-06 18:50:09 +03:00
704b3b709f update cef if newer version exist 2017-12-06 18:21:58 +03:00
e4674915c2 Update cef if exist newer version 2017-12-06 17:19:46 +03:00
e7bbbec0de v5.0.5 2017-11-27 17:06:49 +03:00
4 changed files with 95 additions and 20 deletions

View File

@ -0,0 +1,62 @@
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]
}

View 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"

View File

@ -8,7 +8,7 @@ platform=""
case "$os" in
Linux*) platform="linux" ;;
Darwin*) platform="mac" ;;
Darwin*) platform="mac" ;;
*) exit ;;
esac
@ -35,22 +35,36 @@ echo ""
else
mkdir "build"
fi
cef_binary=cef_binary
cef_arch=$cef_binary.7z
cef_url=http://d2ettrnqo7v976.cloudfront.net/cef/3163/$platform$arch/$cef_arch
if [[ "$platform" == *"linux"* ]]
then
if [[ -f "cef_binary.7z" ]]
then
echo "cef_binary already downloaded"
else
wget http://d2ettrnqo7v976.cloudfront.net/cef/3163/$platform$arch/cef_binary.7z
fi
if [ -d cef_binary ]
then
echo "cef_binary already extracted"
else
7z x -y cef_binary.7z
fi
cp -r -t build/ ./cef_binary/Release/* ./cef_binary/Resources/*
chmod a+xr build/locales
if [[ -f $cef_arch ]]
then
cef_mod_time=$(date -d"$(curl -sI $cef_url | awk '/Last-Modified/ {print ($3, $4, $5, $6, $7, $8)}')" +"%s")
local_mod_time=$(stat -c %Y $cef_arch)
if [[ $cef_mod_time -eq $local_mod_time ]]
then
echo "cef_binary already downloaded"
else
wget $cef_url -O $cef_arch
rm -fr $cef_binary/
fi
else
wget $cef_url
rm -fr $cef_binary/
fi
if [ -d $cef_binary ]
then
echo "cef_binary already extracted"
else
7z x -y $cef_arch
fi
cp -r -t build/ ./$cef_binary/Release/* ./$cef_binary/Resources/*
chmod a+xr build/locales
fi

View File

@ -122,6 +122,9 @@ bool COfficeFileFormatChecker::isPdfFormatFile (unsigned char* pBuffer,int dwByt
if (pBuffer == NULL) return false;
int nTempBufferSize = dwBytes < 20 ? dwBytes : 20;
if (nTempBufferSize < 1)
return false;
char* pTempBuffer = new char[nTempBufferSize];
memcpy ( pTempBuffer, pBuffer, nTempBufferSize );