forked from telegramdesktop/tdesktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.bat
81 lines (63 loc) · 2.3 KB
/
install.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
@echo off
SET BUILD_DIR=C:\TBuild
SET LIB_DIR=%BUILD_DIR%\Libraries
SET SRC_DIR=%BUILD_DIR%\tdesktop
SET QT_VERSION=5_6_2
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
cd %BUILD_DIR%
call:configureBuild
call:getDependencies
call:setupGYP
cd %SRC_DIR%
echo Finished!
GOTO:EOF
:: FUNCTIONS
:logInfo
echo [INFO] %~1
GOTO:EOF
:getDependencies
call:logInfo "Clone dependencies repository"
git clone -q --depth 1 --branch=master https://github.com/telegramdesktop/dependencies_windows.git %LIB_DIR%
cd %LIB_DIR%
call prepare.bat
GOTO:EOF
:setupGYP
call:logInfo "Setup GYP/Ninja and generate VS solution"
cd %LIB_DIR%
git clone https://chromium.googlesource.com/external/gyp
cd gyp
git checkout a478c1ab51
SET PATH=%PATH%;C:\TBuild\Libraries\gyp;C:\TBuild\Libraries\ninja;
cd %SRC_DIR%
git submodule init
git submodule update
cd %SRC_DIR%\Telegram
call gyp\refresh.bat
GOTO:EOF
:configureBuild
call:logInfo "Configuring build"
call:logInfo "Build version: %BUILD_VERSION%"
set TDESKTOP_BUILD_DEFINES=
echo %BUILD_VERSION% | findstr /C:"disable_autoupdate">nul && (
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_AUTOUPDATE
)
echo %BUILD_VERSION% | findstr /C:"disable_register_custom_scheme">nul && (
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
)
echo %BUILD_VERSION% | findstr /C:"disable_crash_reports">nul && (
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_CRASH_REPORTS
)
echo %BUILD_VERSION% | findstr /C:"disable_network_proxy">nul && (
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_NETWORK_PROXY
)
echo %BUILD_VERSION% | findstr /C:"disable_desktop_file_generation">nul && (
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION
)
echo %BUILD_VERSION% | findstr /C:"disable_unity_integration">nul && (
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_UNITY_INTEGRATION
)
if not "%TDESKTOP_BUILD_DEFINES%" == "" (
set "TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES:~1%"
)
call:logInfo "Build Defines: %TDESKTOP_BUILD_DEFINES%"
GOTO:EOF