2015-09-22 10:04:03 +00:00
|
|
|
@echo OFF
|
2015-09-24 18:46:38 +00:00
|
|
|
FOR /F "tokens=1,2* delims= " %%i in (Version) do set "%%i=%%j"
|
2015-09-22 10:04:03 +00:00
|
|
|
|
|
|
|
if %DevChannel% neq 0 goto preparedev
|
|
|
|
|
|
|
|
set "DevParam="
|
2015-09-24 14:17:53 +00:00
|
|
|
set "AppVersionStrFull=%AppVersionStr%"
|
2015-09-22 10:04:03 +00:00
|
|
|
goto devprepared
|
|
|
|
|
|
|
|
:preparedev
|
|
|
|
|
|
|
|
set "DevParam=-dev"
|
2015-09-24 14:17:53 +00:00
|
|
|
set "AppVersionStrFull=%AppVersionStr%.dev"
|
2015-09-22 10:04:03 +00:00
|
|
|
|
|
|
|
:devprepared
|
|
|
|
|
|
|
|
echo.
|
2015-09-28 14:19:37 +00:00
|
|
|
echo Building version %AppVersionStrFull% for Windows..
|
2015-09-22 10:04:03 +00:00
|
|
|
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
|
|
|
|
|
2015-09-23 17:43:08 +00:00
|
|
|
cd SourceFiles\
|
|
|
|
copy telegram.qrc /B+,,/Y
|
|
|
|
cd ..\
|
2015-09-22 10:04:03 +00:00
|
|
|
if %errorlevel% neq 0 goto error
|
|
|
|
|
|
|
|
cd ..\
|
|
|
|
MSBuild Telegram.sln /property:Configuration=Deploy
|
2015-09-23 17:43:08 +00:00
|
|
|
if %errorlevel% neq 0 goto error0
|
2015-09-22 10:04:03 +00:00
|
|
|
|
|
|
|
echo .
|
2015-09-24 14:17:53 +00:00
|
|
|
echo Version %AppVersionStrFull% build successfull! Preparing..
|
2015-09-22 10:04:03 +00:00
|
|
|
echo .
|
|
|
|
|
|
|
|
set "PATH=%PATH%;C:\Program Files\7-Zip;C:\Program Files (x86)\Inno Setup 5"
|
2015-09-23 17:43:08 +00:00
|
|
|
cd Win32\Deploy\
|
2015-09-22 10:04:03 +00:00
|
|
|
|
|
|
|
call ..\..\..\TelegramPrivate\Sign.bat Telegram.exe
|
|
|
|
if %errorlevel% neq 0 goto error1
|
|
|
|
|
|
|
|
call ..\..\..\TelegramPrivate\Sign.bat Updater.exe
|
|
|
|
if %errorlevel% neq 0 goto error1
|
|
|
|
|
2015-09-24 14:17:53 +00:00
|
|
|
iscc /dMyAppVersion=%AppVersionStrSmall% /dMyAppVersionZero=%AppVersionStr% /dMyAppVersionFull=%AppVersionStrFull% ..\..\Telegram\Setup.iss
|
2015-09-22 10:04:03 +00:00
|
|
|
if %errorlevel% neq 0 goto error1
|
|
|
|
|
2015-09-24 14:17:53 +00:00
|
|
|
call ..\..\..\TelegramPrivate\Sign.bat tsetup.%AppVersionStrFull%.exe
|
2015-09-22 10:04:03 +00:00
|
|
|
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%
|
2015-09-24 14:17:53 +00:00
|
|
|
mkdir deploy\%AppVersionStrMajor%\%AppVersionStrFull%
|
|
|
|
mkdir deploy\%AppVersionStrMajor%\%AppVersionStrFull%\Telegram
|
2015-09-22 10:04:03 +00:00
|
|
|
if %errorlevel% neq 0 goto error1
|
|
|
|
|
2015-09-24 14:17:53 +00:00
|
|
|
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%\
|
2015-09-22 10:04:03 +00:00
|
|
|
if %errorlevel% neq 0 goto error1
|
|
|
|
|
2015-09-24 14:17:53 +00:00
|
|
|
cd deploy\%AppVersionStrMajor%\%AppVersionStrFull%\
|
|
|
|
7z a -mx9 tportable.%AppVersionStrFull%.zip Telegram\
|
2015-09-22 10:04:03 +00:00
|
|
|
if %errorlevel% neq 0 goto error2
|
|
|
|
|
|
|
|
echo .
|
2015-09-24 14:17:53 +00:00
|
|
|
echo Version %AppVersionStrFull% is ready for deploy!
|
2015-09-22 10:04:03 +00:00
|
|
|
echo .
|
|
|
|
|
|
|
|
if not exist tupdate%AppVersion% goto error2
|
2015-09-24 14:17:53 +00:00
|
|
|
if not exist tportable.%AppVersionStrFull%.zip goto error2
|
|
|
|
if not exist tsetup.%AppVersionStrFull%.exe goto error2
|
2015-09-22 10:04:03 +00:00
|
|
|
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%
|
2015-09-24 14:17:53 +00:00
|
|
|
if not exist Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull% mkdir Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull%
|
2015-09-22 10:04:03 +00:00
|
|
|
|
2015-09-24 14:17:53 +00:00
|
|
|
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%\
|
2015-09-22 10:04:03 +00:00
|
|
|
|
2015-09-24 14:17:53 +00:00
|
|
|
echo Version %AppVersionStrFull% is ready!
|
2015-09-22 10:04:03 +00:00
|
|
|
|
2015-09-23 17:43:08 +00:00
|
|
|
cd ..\..\..\..\..\Telegram\
|
2015-09-22 10:04:03 +00:00
|
|
|
goto eof
|
|
|
|
|
|
|
|
:error2
|
2015-09-23 17:43:08 +00:00
|
|
|
cd ..\..\..\
|
2015-09-22 10:04:03 +00:00
|
|
|
:error1
|
2015-09-23 17:43:08 +00:00
|
|
|
cd ..\..\
|
|
|
|
:error0
|
|
|
|
cd Telegram\
|
2015-09-22 10:04:03 +00:00
|
|
|
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
|
2015-09-24 14:17:53 +00:00
|
|
|
echo ERROR occured!
|
2015-09-22 10:04:03 +00:00
|
|
|
exit /b %errorlevel%
|
|
|
|
|
|
|
|
:eof
|