From 957e8a06f282d4f1a52f07f429fe00b9d20c60af Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 20 Oct 2015 00:16:25 +0200 Subject: [PATCH] added renamed Build.bat script and _openssl_patch to git --- Telegram/Build.bat | 123 +++++++++++++++++++++++++++++++++++ Telegram/_openssl_patch.diff | 13 ++++ 2 files changed, 136 insertions(+) create mode 100644 Telegram/Build.bat create mode 100644 Telegram/_openssl_patch.diff diff --git a/Telegram/Build.bat b/Telegram/Build.bat new file mode 100644 index 000000000..e0a9d9ac3 --- /dev/null +++ b/Telegram/Build.bat @@ -0,0 +1,123 @@ +@echo OFF +FOR /F "tokens=1,2* delims= " %%i in (Version) do set "%%i=%%j" + +if %DevChannel% neq 0 goto preparedev + +set "DevParam=" +set "AppVersionStrFull=%AppVersionStr%" +goto devprepared + +:preparedev + +set "DevParam=-dev" +set "AppVersionStrFull=%AppVersionStr%.dev" + +:devprepared + +echo. +echo Building version %AppVersionStrFull% for Windows.. +echo. + +if exist ..\Win32\Deploy\deploy\%AppVersionStrMajor%\%AppVersionStr%\ goto error_exist1 +if exist ..\Win32\Deploy\deploy\%AppVersionStrMajor%\%AppVersionStr%.dev\ goto error_exist2 +if exist ..\Win32\Deploy\tupdate%AppVersion% goto error_exist3 + +cd SourceFiles\ +copy telegram.qrc /B+,,/Y +cd ..\ +if %errorlevel% neq 0 goto error + +cd ..\ +MSBuild Telegram.sln /property:Configuration=Deploy +if %errorlevel% neq 0 goto error0 + +echo . +echo Version %AppVersionStrFull% build successfull! Preparing.. +echo . + +set "PATH=%PATH%;C:\Program Files\7-Zip;C:\Program Files (x86)\Inno Setup 5" +cd Win32\Deploy\ + +call ..\..\..\TelegramPrivate\Sign.bat Telegram.exe +if %errorlevel% neq 0 goto error1 + +call ..\..\..\TelegramPrivate\Sign.bat Updater.exe +if %errorlevel% neq 0 goto error1 + +iscc /dMyAppVersion=%AppVersionStrSmall% /dMyAppVersionZero=%AppVersionStr% /dMyAppVersionFull=%AppVersionStrFull% ..\..\Telegram\Setup.iss +if %errorlevel% neq 0 goto error1 + +call ..\..\..\TelegramPrivate\Sign.bat tsetup.%AppVersionStrFull%.exe +if %errorlevel% neq 0 goto error1 + +call Packer.exe -version %AppVersion% -path Telegram.exe -path Updater.exe %DevParam% +if %errorlevel% neq 0 goto error1 + +if not exist deploy mkdir deploy +if not exist deploy\%AppVersionStrMajor% mkdir deploy\%AppVersionStrMajor% +mkdir deploy\%AppVersionStrMajor%\%AppVersionStrFull% +mkdir deploy\%AppVersionStrMajor%\%AppVersionStrFull%\Telegram +if %errorlevel% neq 0 goto error1 + +move Telegram.exe deploy\%AppVersionStrMajor%\%AppVersionStrFull%\Telegram\ +move Updater.exe deploy\%AppVersionStrMajor%\%AppVersionStrFull%\ +move Telegram.pdb deploy\%AppVersionStrMajor%\%AppVersionStrFull%\ +move Updater.pdb deploy\%AppVersionStrMajor%\%AppVersionStrFull%\ +move tsetup.%AppVersionStrFull%.exe deploy\%AppVersionStrMajor%\%AppVersionStrFull%\ +move tupdate%AppVersion% deploy\%AppVersionStrMajor%\%AppVersionStrFull%\ +if %errorlevel% neq 0 goto error1 + +cd deploy\%AppVersionStrMajor%\%AppVersionStrFull%\ +7z a -mx9 tportable.%AppVersionStrFull%.zip Telegram\ +if %errorlevel% neq 0 goto error2 + +echo . +echo Version %AppVersionStrFull% is ready for deploy! +echo . + +if not exist tupdate%AppVersion% goto error2 +if not exist tportable.%AppVersionStrFull%.zip goto error2 +if not exist tsetup.%AppVersionStrFull%.exe goto error2 +if not exist Telegram.pdb goto error2 +if not exist Updater.exe goto error2 +if not exist Updater.pdb goto error2 +if not exist Z:\TBuild\tother\tsetup\%AppVersionStrMajor% mkdir Z:\TBuild\tother\tsetup\%AppVersionStrMajor% +if not exist Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull% mkdir Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull% + +xcopy tupdate%AppVersion% Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull%\ +xcopy tportable.%AppVersionStrFull%.zip Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull%\ +xcopy tsetup.%AppVersionStrFull%.exe Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull%\ +xcopy Telegram.pdb Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull%\ +xcopy Updater.exe Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull%\ +xcopy Updater.pdb Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull%\ + +echo Version %AppVersionStrFull% is ready! + +cd ..\..\..\..\..\Telegram\ +goto eof + +:error2 +cd ..\..\..\ +:error1 +cd ..\..\ +:error0 +cd Telegram\ +goto error + +:error_exist1 +echo Deploy folder for version %AppVersionStr% already exists! +exit /b 1 + +:error_exist2 +echo Deploy folder for version %AppVersionStr%.dev already exists! +exit /b 1 + +:error_exist3 +echo Update file for version %AppVersion% already exists! +exit /b 1 + +:error +echo ERROR occured! +exit /b %errorlevel% + +:eof diff --git a/Telegram/_openssl_patch.diff b/Telegram/_openssl_patch.diff new file mode 100644 index 000000000..51df18a67 --- /dev/null +++ b/Telegram/_openssl_patch.diff @@ -0,0 +1,13 @@ +diff --git a/e_os.h b/e_os.h +index 7584485..0b37c94 100644 +--- a/e_os.h ++++ b/e_os.h +@@ -315,7 +315,7 @@ static __inline unsigned int _strlen31(const char *str) + # undef isxdigit + # endif + # if defined(_MSC_VER) && !defined(_DLL) && defined(stdin) +-# if _MSC_VER>=1300 ++# if (_MSC_VER>=1300) && (_MSC_VER<=1800) + # undef stdin + # undef stdout + # undef stderr