-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.cmd
280 lines (231 loc) · 8.75 KB
/
install.cmd
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
::
:: CMGen
:: Copyright (C) 2015 Dmitriy Ka
::
:: This program is free software; you can redistribute it and/or
:: modify it under the terms of the GNU General Public License
:: as published by the Free Software Foundation; either version 2
:: of the License, or (at your option) any later version.
::
:: This program is distributed in the hope that it will be useful,
:: but WITHOUT ANY WARRANTY; without even the implied warranty of
:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
:: GNU General Public License for more details.
::
:: You should have received a copy of the GNU General Public License
:: along with this program; if not, write to the Free Software
:: Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
::
setlocal enableextensions enabledelayedexpansion&set BUILDBIN=%~dp0&&set BUILDBIN=!BUILDBIN:~0,-1!
cd /d %BUILDBIN%\tools
@echo on
:: MSYS
@if EXIST %BUILDBIN%\tools\msys\usr\bin\bash.exe (
echo MSYS is already installed, skipping
goto SKIP_MSYS
)
@echo Downloading MSYS...
cscript %BUILDBIN%\httpget.js http://downloads.sourceforge.net/project/msys2/Base/x86_64/msys2-x86_64-20150916.exe msys2.exe
::if NOT '%ERRORLEVEL%'=='0' goto ERROR
@echo Installing MSYS...
set TARGET_DIR=%BUILDBIN%\tools\msys
%BUILDBIN%\tools\msys2.exe --script %BUILDBIN%\qtscript.js
if NOT '%ERRORLEVEL%'=='0' goto ERROR
del /Q %BUILDBIN%\tools\msys2.exe
cd /d %BUILDBIN%\tools\msys\usr\bin
@echo Installing MSYS packages...
pacman -Sy --noconfirm
if NOT '%ERRORLEVEL%'=='0' goto ERROR
pacman -S curl --noconfirm
if NOT '%ERRORLEVEL%'=='0' goto ERROR
pacman -S wget --noconfirm
if NOT '%ERRORLEVEL%'=='0' goto ERROR
pacman -S patch --noconfirm
if NOT '%ERRORLEVEL%'=='0' goto ERROR
pacman -S make --noconfirm
if NOT '%ERRORLEVEL%'=='0' goto ERROR
pacman -S nasm --noconfirm
if NOT '%ERRORLEVEL%'=='0' goto ERROR
pacman -S yasm --noconfirm
if NOT '%ERRORLEVEL%'=='0' goto ERROR
pacman -S unzip --noconfirm
if NOT '%ERRORLEVEL%'=='0' goto ERROR
ren link.exe msyslink.exe
if NOT '%ERRORLEVEL%'=='0' goto ERROR
cd /d %BUILDBIN%\tools
:SKIP_MSYS
:: CMAKE
@if EXIST %BUILDBIN%\tools\cmake\bin\cmake.exe (
echo CMake is already installed, skipping
goto SKIP_CMAKE
)
@echo Downloading CMake...
%BUILDBIN%\tools\msys\usr\bin\curl.exe -o %BUILDBIN%\tools\cmake.zip -L https://cmake.org/files/v3.4/cmake-3.4.1-win32-x86.zip
if NOT '%ERRORLEVEL%'=='0' goto ERROR
@echo Unpacking CMake...
mkdir %BUILDBIN%\tools\cmake
%BUILDBIN%\tools\msys\usr\bin\bsdtar.exe -xf %BUILDBIN%\tools\cmake.zip --strip=1 -C %BUILDBIN%\tools\cmake
if NOT '%ERRORLEVEL%'=='0' goto ERROR
del /Q %BUILDBIN%\tools\cmake.zip
::del /Q %BUILDBIN%\tools\cmake\share\cmake-3.3\Modules\FindZLIB.cmake
::del /Q %BUILDBIN%\tools\cmake\share\cmake-3.3\Modules\FindFreetype.cmake
::del /Q %BUILDBIN%\tools\cmake\share\cmake-3.3\Modules\FindThreads.cmake
:SKIP_CMAKE
:: PERL
@if EXIST %BUILDBIN%\tools\perl\perl\bin\perl.exe (
echo Perl is already installed, skipping
goto SKIP_PERL
)
@echo Downloading Perl...
%BUILDBIN%\tools\msys\usr\bin\curl.exe -o %BUILDBIN%\tools\perl.zip -L http://strawberryperl.com/download/5.20.3.1/strawberry-perl-5.20.3.1-32bit-portable.zip
if NOT '%ERRORLEVEL%'=='0' goto ERROR
@echo Unpacking Perl...
mkdir %BUILDBIN%\tools\perl
%BUILDBIN%\tools\msys\usr\bin\bsdtar.exe -xf %BUILDBIN%\tools\perl.zip -C %BUILDBIN%\tools\perl
:: msiexec /qb /L*v perl-log.txt /i perl.msi ADDLOCAL="PERL_FEATURE" PERL_PATH=No PERL_EXT=No INSTALLDIR=%BUILDBIN%\tools\perl
if NOT '%ERRORLEVEL%'=='0' goto ERROR
del /Q %BUILDBIN%\tools\perl.zip
:SKIP_PERL
:: HG
@if EXIST %BUILDBIN%\tools\Hg\hg.exe (
echo Hg is already installed, skipping
goto SKIP_HG
)
@echo Downloading Hg...
%BUILDBIN%\tools\msys\usr\bin\curl.exe -o %BUILDBIN%\tools\tortoisehg.msi -L http://bitbucket.org/tortoisehg/files/downloads/tortoisehg-2.7.1-hg-2.5.2-x86.msi
if NOT '%ERRORLEVEL%'=='0' goto ERROR
@echo Unpacking Hg...
mkdir %BUILDBIN%\tools\hgtmp
mkdir %BUILDBIN%\tools\hg
msiexec /a tortoisehg.msi /qb TARGETDIR=%BUILDBIN%\tools\hgtmp
if NOT '%ERRORLEVEL%'=='0' goto ERROR
mkdir hg
xcopy %BUILDBIN%\tools\hgtmp\pfiles\tortoisehg\* %BUILDBIN%\tools\hg /s /i
rmdir /S /Q %BUILDBIN%\tools\hgtmp
del /Q %BUILDBIN%\tools\tortoisehg.msi
:SKIP_HG
:: GIT
@if EXIST %BUILDBIN%\tools\PortableGit\bin\git.exe (
echo Git is already installed, skipping
goto SKIP_GIT
)
@echo Downloading Git...
%BUILDBIN%\tools\msys\usr\bin\curl.exe -o %BUILDBIN%\tools\git.exe -L https://github.com/git-for-windows/git/releases/download/v2.6.2.windows.1/PortableGit-2.6.2-64-bit.7z.exe
if NOT '%ERRORLEVEL%'=='0' goto ERROR
@echo Unpacking Git...
cd /d %BUILDBIN%\tools
%BUILDBIN%\tools\git.exe -y -dm1
if NOT '%ERRORLEVEL%'=='0' goto ERROR
del /Q %BUILDBIN%\tools\git.exe
:SKIP_GIT
:: PYTHON
@if EXIST %BUILDBIN%\tools\python\python.exe (
echo Python is already installed, skipping
goto SKIP_PYTHON
)
@echo Downloading Python...
%BUILDBIN%\tools\msys\usr\bin\curl.exe -o %BUILDBIN%\tools\python.msi -L http://downloads.activestate.com/ActivePython/releases/2.7.10.12/ActivePython-2.7.10.12-win64-x64.msi
if NOT '%ERRORLEVEL%'=='0' goto ERROR
@echo Installing Python...
mkdir %BUILDBIN%\tools\python
::Full install: msiexec /qb /L*v python-log.txt /i python.msi ADDLOCAL="core,pywin32" INSTALLDIR=%BUILDBIN%\tools\python
msiexec /a python.msi /qb TARGETDIR=%BUILDBIN%\tools\pytmp
if NOT '%ERRORLEVEL%'=='0' goto ERROR
mkdir python
xcopy %BUILDBIN%\tools\pytmp\WINVOL\Python27\* %BUILDBIN%\tools\python /s /i
del /Q %BUILDBIN%\tools\python.msi
rmdir /S /Q %BUILDBIN%\tools\pytmp
:SKIP_PYTHON
:: SCONS
@if EXIST %BUILDBIN%\tools\python\scons.bat (
echo SCons is already installed, skipping
goto SKIP_SCONS
)
@echo Downloading SCons...
%BUILDBIN%\tools\msys\usr\bin\curl.exe -o %BUILDBIN%\tools\scons.zip -L http://prdownloads.sourceforge.net/scons/scons-2.4.0.zip
if NOT '%ERRORLEVEL%'=='0' goto ERROR
@echo Unpacking SCons...
mkdir %BUILDBIN%\tools\scons
%BUILDBIN%\tools\msys\usr\bin\bsdtar.exe -xf %BUILDBIN%\tools\scons.zip --strip=1 -C %BUILDBIN%\tools\scons
if NOT '%ERRORLEVEL%'=='0' goto ERROR
@echo Installing SCons...
%BUILDBIN%\tools\python\python %BUILDBIN%\tools\scons\setup.py install
if NOT '%ERRORLEVEL%'=='0' goto ERROR
del /Q %BUILDBIN%\tools\scons.zip
:SKIP_SCONS
:: JOM
@if EXIST %BUILDBIN%\tools\jom\jom.exe (
echo JOM is already installed, skipping
goto SKIP_JOM
)
@echo Downloading jom...
%BUILDBIN%\tools\msys\usr\bin\curl.exe -o %BUILDBIN%\tools\jom.zip -L http://download.qt.io/official_releases/jom/jom_1_0_15.zip
if NOT '%ERRORLEVEL%'=='0' goto ERROR
@echo Unpacking jom...
mkdir %BUILDBIN%\tools\jom
%BUILDBIN%\tools\msys\usr\bin\bsdtar.exe -xf %BUILDBIN%\tools\jom.zip -C %BUILDBIN%\tools\jom
if NOT '%ERRORLEVEL%'=='0' goto ERROR
del /Q %BUILDBIN%\tools\jom.zip
:SKIP_JOM
:: RUBY
@if EXIST %BUILDBIN%\tools\ruby\bin\ruby.exe (
echo Ruby is already installed, skipping
goto SKIP_RUBY
)
@echo Downloading Ruby...
%BUILDBIN%\tools\msys\usr\bin\curl.exe -o %BUILDBIN%\tools\ruby.exe -L http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.2.3-x64.exe
if NOT '%ERRORLEVEL%'=='0' goto ERROR
@echo Installing Ruby...
mkdir %BUILDBIN%\tools\ruby
%BUILDBIN%\tools\ruby.exe /SILENT /LOG /DIR=%BUILDBIN%\tools\ruby
if NOT '%ERRORLEVEL%'=='0' goto ERROR
del /Q %BUILDBIN%\tools\ruby.exe
:SKIP_RUBY
:: NINJA
@if EXIST %BUILDBIN%\tools\ninja\ninja.exe (
echo Ninja is already installed, skipping
goto SKIP_NINJA
)
@echo Downloading ninja...
%BUILDBIN%\tools\msys\usr\bin\curl.exe -o %BUILDBIN%\tools\ninja.zip -L https://github.com/ninja-build/ninja/releases/download/v1.6.0/ninja-win.zip
if NOT '%ERRORLEVEL%'=='0' goto ERROR
@echo Unpacking ninja...
mkdir %BUILDBIN%\tools\ninja
%BUILDBIN%\tools\msys\usr\bin\bsdtar.exe -xf %BUILDBIN%\tools\ninja.zip -C %BUILDBIN%\tools\ninja
if NOT '%ERRORLEVEL%'=='0' goto ERROR
del /Q %BUILDBIN%\tools\ninja.zip
:SKIP_NINJA
:: 7ZIP
@if EXIST %BUILDBIN%\tools\7zip\7za.exe (
echo 7zip is already installed, skipping
goto SKIP_7ZIP
)
@echo Downloading 7zip...
%BUILDBIN%\tools\msys\usr\bin\curl.exe -o %BUILDBIN%\tools\7zip.zip -L http://www.7-zip.org/a/7za920.zip
if NOT '%ERRORLEVEL%'=='0' goto ERROR
@echo Unpacking 7zip...
mkdir %BUILDBIN%\tools\7zip
%BUILDBIN%\tools\msys\usr\bin\bsdtar.exe -xf %BUILDBIN%\tools\7zip.zip -C %BUILDBIN%\tools\7zip
if NOT '%ERRORLEVEL%'=='0' goto ERROR
del /Q %BUILDBIN%\tools\7zip.zip
:SKIP_7ZIP
:: CMGEN
@if EXIST %BUILDBIN%\cmgen\cmgen.exe (
echo CMGen is already installed, skipping
goto SKIP_CMGEN
)
@echo Configuring CMGen...
rmdir /S /Q %BUILDBIN%\cmgen-build
mkdir %BUILDBIN%\cmgen-build
cd /d %BUILDBIN%\cmgen-build
%BUILDBIN%\tools\cmake\bin\cmake.exe -G"Visual Studio 14 2015" %BUILDBIN%\source
if NOT '%ERRORLEVEL%'=='0' goto ERROR
@echo Building CMGen...
%BUILDBIN%\tools\cmake\bin\cmake.exe --build . --config Release
if NOT '%ERRORLEVEL%'=='0' goto ERROR
:SKIP_CMGEN
goto EXIT
:ERROR
@echo Error occured
exit /B 1
:EXIT