forked from telegramdesktop/tdesktop
-
Notifications
You must be signed in to change notification settings - Fork 1
/
PrepareWin.bat
91 lines (67 loc) · 2.67 KB
/
PrepareWin.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
@echo OFF
set "AppVersionStrMajor=0.8"
set "AppVersion=8036"
set "AppVersionStrSmall=0.8.36"
set "AppVersionStr=0.8.36"
set "AppVersionStrFull=0.8.36.0"
set "DevChannel=0"
if %DevChannel% neq 0 goto preparedev
set "DevPostfix="
set "DevParam="
goto devprepared
:preparedev
set "DevPostfix=.dev"
set "DevParam=-dev"
:devprepared
echo.
echo Preparing version %AppVersionStr%%DevPostfix%..
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
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% /dMyAppFullVersion=%AppVersionStrFull% /dMyAppVersionForExe=%AppVersionStr%%DevPostfix% ..\..\Telegram\Setup.iss
if %errorlevel% neq 0 goto error1
call ..\..\..\TelegramPrivate\Sign.bat tsetup.%AppVersionStr%%DevPostfix%.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%\%AppVersionStr%%DevPostfix%
mkdir deploy\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%\Telegram
move Telegram.exe deploy\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%\Telegram\
move Updater.exe deploy\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%\
move Telegram.pdb deploy\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%\
move Updater.pdb deploy\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%\
move tsetup.%AppVersionStr%%DevPostfix%.exe deploy\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%\
move tupdate%AppVersion% deploy\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%\
cd deploy\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%
7z a -mx9 tportable.%AppVersionStr%%DevPostfix%.zip Telegram\
if %errorlevel% neq 0 goto error2
echo .
echo Version %AppVersionStr%%DevPostfix% is ready for deploy!
echo .
cd ..\..\..\..\..\Telegram
goto eof
:error2
cd ..\..\..
:error1
cd ..\..\Telegram
echo ERROR occured!
exit /b %errorlevel%
: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
:eof