]> Creatis software - creaToolsTools.git/blob - Install_ThirdParty/scripts/download_ThirdPartySW.bat
DFCH: ThirdParty Libraries installer generator working -- script tested and updated...
[creaToolsTools.git] / Install_ThirdParty / scripts / download_ThirdPartySW.bat
1 @echo off
2 echo -----------------------------------
3 echo --------Download Libraries---------
4 echo -----------------------------------
5
6 echo -----------------------------------
7 echo ---Setting Environment Variables---
8 echo -----------------------------------
9
10 set thirdpartyGeneration=%1
11 set buildType=%2
12 set wxStable=%3
13
14 :: set urlCreatisSource=http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source
15 set urlCreatisSource=http://www.creatis.insa-lyon.fr/~caceres/software
16
17 if %PROCESSOR_ARCHITECTURE%==x86 (
18   set ProgramFilesPath_x86=%ProgramFiles%
19   echo "Architecture found = x86"
20 ) else (
21   set "ProgramFilesPath_x64=%ProgramFiles%"
22   set "ProgramFilesPath_x86=%ProgramFiles(x86)%"
23   echo "Architecture found = x64"
24 )
25
26 set zipPath="%ProgramFilesPath_x86%\7-Zip\7z.exe"
27 set miktex="%ProgramFilesPath_x86%\MiKTeX 2.9\miktex\bin\texworks.exe"
28 set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
29 set wgetPath="%ProgramFilesPath_x86%\GnuWin32\bin\wget.exe"
30
31 if not exist %zipPath% set zipPath="%ProgramFilesPath_x64%\7-Zip\7z.exe"
32 if not exist %zipPath% (
33   echo ERROR!!! 7Zip has not been found in the system
34   exit
35 )
36 if not exist %vcvarsall% set vcvarsall="%ProgramFilesPath_x64%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
37 if not exist %vcvarsall% (
38   echo ERROR!!! Visual Studio has not been found in the system
39   exit
40 )
41
42 if not exist %miktex% (
43  set miktex="%ProgramFilesPath_x64%\MiKTeX 2.9\miktex\bin\texworks.exe"
44  if not exist %miktex% (
45   echo ERROR!!! MiKTex has not been found in the system
46   exit
47  )
48 )
49
50 if not exist %wgetPath% (
51   echo ERROR!!! wget has not been found in the system
52   exit
53 )
54
55 set installpath=%thirdpartyGeneration%\thirdparty_install\%buildType%
56 set binpath=%thirdpartyGeneration%\thirdparty_bin\%buildType%
57 set sourcepath=%thirdpartyGeneration%\thirdparty_source\%buildType%
58
59 set QTFNAME=qt-everywhere-opensource-src-4.8.2.zip
60
61 if %wxStable%==ON (
62         set WXFNAME=wxWidgets-2.8.12.zip
63         set WXVERSION=2.8.12
64 ) else (
65         set WXFNAME=wxWidgets-2.9.3.zip
66         set WXVERSION=2.9.2
67 )
68 else
69 set BOOSTFNAME=boost_1_49_0.7z
70 set XERCESFNAME=xerces-c-3.1.1.zip
71 set ITKFNAME=InsightToolkit-3.20.1.zip
72 set VTKFNAME=vtk-5.10.0.zip
73 set GDCMFNAME=gdcm_11_Oct_2011.tar
74 ::set GDCMFNAME=gdcm_05_Mai_2011.tar
75 set TTHFNAME=tth_exe.zip
76 set JOMFNAME=jom.zip
77
78 echo -----------------------------------
79 echo Environment variables Configuration
80 echo -----------------------------------
81 echo ThirdpartyGeneration=%thirdpartyGeneration%
82 echo BuildType=%buildType%
83 echo wget=%wgetPath%
84 echo MikTex=%miktex%
85 echo urlCreatis=%urlCreatisSource%
86 echo 7zip=%zipPath%
87 echo Visual Studio=%vcvarsall%
88 echo InstallPath=%installpath%
89 echo BinPath=%binpath%
90 echo SourcePath=%sourcepath%
91
92 echo -----------------------------------
93 echo -------Removing Folders------------
94 echo -----------------------------------
95
96 rmdir /S /Q %thirdpartyGeneration%
97
98 echo -----------------------------------
99 echo -------Creating Folders------------
100 echo -----------------------------------
101
102 mkdir %thirdpartyGeneration%
103 cd  %thirdpartyGeneration%
104 mkdir %sourcepath%
105 mkdir %binpath%
106 mkdir %installpath%
107
108 echo -----------------------------------
109 echo ------Downloading Sources----------
110 echo -----------------------------------
111
112 cd %sourcepath%\
113
114 %wgetPath% "http://releases.qt-project.org/qt4/source/%QTFNAME%"
115 %wgetPath% "http://sourceforge.net/projects/wxwindows/files/%WXVERSION%/%WXFNAME%/download"
116 %wgetPath% "http://sourceforge.net/projects/boost/files/boost/1.49.0/%BOOSTFNAME%/download"
117 %wgetPath% "http://mirror.ibcp.fr/pub/apache//xerces/c/3/sources/%XERCESFNAME%"
118 %wgetPath% "http://sourceforge.net/projects/itk/files/itk/3.20/%ITKFNAME%/download"
119 %wgetPath% "http://www.vtk.org/files/release/5.10/%VTKFNAME%"
120 %wgetPath% "%urlCreatisSource%/%GDCMFNAME%.gz"
121 %wgetPath% "http://hutchinson.belmont.ma.us/tth/tth-noncom/%TTHFNAME%"
122 %wgetPath% "ftp://ftp.qt.nokia.com/jom/%JOMFNAME%"
123
124 echo -----------------------------------
125 echo --------------Qt-------------------
126 echo -----------------------------------
127 call %vcvarsall%
128
129 cd %sourcepath%
130 %zipPath% x %sourcepath%\%QTFNAME%
131 del %sourcepath%\%QTFNAME%
132
133 echo -----------------------------------
134 echo --------------JOM------------------
135 echo -----------------------------------
136
137 cd %sourcepath%
138 %zipPath% x %sourcepath%\%JOMFNAME% -o*
139 del %sourcepath%\%JOMFNAME%
140
141 echo -----------------------------------
142 echo -----------wxWidgets---------------
143 echo -----------------------------------
144 echo ----------Extracting---------------
145
146 cd %sourcepath%
147 %zipPath% x %sourcepath%\%WXFNAME%
148   del %sourcepath%\%WXFNAME%
149
150 echo -----------------------------------
151 echo ------------Boost------------------
152 echo -----------------------------------
153
154 cd %sourcepath%
155 %zipPath% x %sourcepath%\%BOOSTFNAME%
156 del %sourcepath%\%BOOSTFNAME%
157
158 echo -----------------------------------
159 echo -------------VTK-------------------
160 echo -----------------------------------
161
162 cd %sourcepath%
163 %zipPath% x %sourcepath%\%VTKFNAME%
164 del %sourcepath%\%VTKFNAME%
165
166 echo -----------------------------------
167 echo ------------GDCM ------------------
168 echo -----------------------------------
169
170 cd %sourcepath%
171 %zipPath% x %GDCMFNAME%.gz
172 %zipPath% x %GDCMFNAME%
173 del %GDCMFNAME%.gz
174 del %GDCMFNAME%
175
176 echo -----------------------------------
177 echo -------------ITK-------------------
178 echo -----------------------------------
179
180 cd %sourcepath%
181 %zipPath% x %ITKFNAME%
182 del %ITKFNAME%
183
184 echo -----------------------------------
185 echo -------------XERCES----------------
186 echo -----------------------------------
187
188 cd %sourcepath%
189 %zipPath% x %XERCESFNAME%
190 del %XERCESFNAME%
191
192 echo -----------------------------------
193 echo --------------TTH------------------
194 echo -----------------------------------
195
196 cd %sourcepath%
197 %zipPath% x %TTHFNAME%
198 del %TTHFNAME%
199
200 echo ------End TTH Installation---------
201
202 echo -----------------------------------
203
204 echo -----------------------------------
205 echo --------Renaming Folders-----------
206 echo -----------------------------------
207 cd %sourcepath%
208 rename qt-everywhere-opensource-src-4.8.2 qt
209 rename wxWidgets-%WXVERSION% wxWidgets
210 rename boost_1_49_0 boost
211 rename InsightToolkit-3.20.1 itk
212 rename VTK vtk
213 rename gdcm gdcm
214 rename tth_exe tth
215 rename xerces-c-3.1.1 xerces
216
217 echo -----End of Download Libraries-----
218 echo -----------------------------------
219 echo -----------------------------------
220 echo -----------------------------------
221 echo -----------------------------------
222 echo -----------------------------------
223 echo -----------------------------------
224 echo -----------------------------------
225 echo -----------------------------------
226 echo -----------------------------------
227 echo -----------------------------------
228 echo -----------------------------------
229 echo -----------------------------------
230 echo -----------------------------------
231 echo -----------------------------------
232 echo -----------------------------------
233 echo -----------------------------------
234 echo -----------------------------------
235 echo -----------------------------------
236 echo -----------------------------------
237 echo -----------------------------------
238 echo -----------------------------------
239 echo -----------------------------------
240 echo -----------------------------------
241 echo -----------------------------------
242
243 exit /B