]> Creatis software - creaToolsTools.git/blob - Install_ThirdParty/scripts/download_ThirdPartySW.bat
DFCH: Install_ThirdParty script is now working in windows x64 =)
[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 set LogFolder=%thirdpartyGeneration%\installLog
59
60 set QTFNAME=qt-everywhere-opensource-src-4.8.2.zip
61
62 if %wxStable%==ON (
63         set WXFNAME=wxWidgets-2.8.12.zip
64         set WXVERSION=2.8.12
65 ) else (
66         set WXFNAME=wxWidgets-2.9.3.zip
67         set WXVERSION=2.9.2
68 )
69 else
70 set BOOSTFNAME=boost_1_49_0.7z
71 set XERCESFNAME=xerces-c-3.1.1.zip
72 set ITKFNAME=InsightToolkit-3.20.1.zip
73 set VTKFNAME=vtk-5.10.0.zip
74 set GDCMFNAME=gdcm_11_Oct_2011.tar
75 ::set GDCMFNAME=gdcm_05_Mai_2011.tar
76 set TTHFNAME=tth_exe.zip
77 set JOMFNAME=jom.zip
78
79 echo -----------------------------------
80 echo Environment variables Configuration
81 echo -----------------------------------
82 echo ThirdpartyGeneration=%thirdpartyGeneration%
83 echo BuildType=%buildType%
84 echo wget=%wgetPath%
85 echo MikTex=%miktex%
86 echo urlCreatis=%urlCreatisSource%
87 echo 7zip=%zipPath%
88 echo Visual Studio=%vcvarsall%
89 echo InstallPath=%installpath%
90 echo BinPath=%binpath%
91 echo SourcePath=%sourcepath%
92
93 echo -----------------------------------
94 echo ------Downloading Sources----------
95 echo -----------------------------------
96
97 cd %sourcepath%\
98
99 %wgetPath% "http://releases.qt-project.org/qt4/source/%QTFNAME%"
100 %wgetPath% "http://sourceforge.net/projects/wxwindows/files/%WXVERSION%/%WXFNAME%/download"
101 %wgetPath% "http://sourceforge.net/projects/boost/files/boost/1.49.0/%BOOSTFNAME%/download"
102 %wgetPath% "http://mirror.ibcp.fr/pub/apache//xerces/c/3/sources/%XERCESFNAME%"
103 %wgetPath% "http://sourceforge.net/projects/itk/files/itk/3.20/%ITKFNAME%/download"
104 %wgetPath% "http://www.vtk.org/files/release/5.10/%VTKFNAME%"
105 %wgetPath% "%urlCreatisSource%/%GDCMFNAME%.gz"
106 %wgetPath% "http://hutchinson.belmont.ma.us/tth/tth-noncom/%TTHFNAME%"
107 %wgetPath% "ftp://ftp.qt.nokia.com/jom/%JOMFNAME%"
108
109 echo -----------------------------------
110 echo --------------Qt-------------------
111 echo -----------------------------------
112 call %vcvarsall%
113
114 cd %sourcepath%
115 %zipPath% x %sourcepath%\%QTFNAME%
116 del %sourcepath%\%QTFNAME%
117
118 echo -----------------------------------
119 echo --------------JOM------------------
120 echo -----------------------------------
121
122 cd %sourcepath%
123 %zipPath% x %sourcepath%\%JOMFNAME% -o*
124 del %sourcepath%\%JOMFNAME%
125
126 echo -----------------------------------
127 echo -----------wxWidgets---------------
128 echo -----------------------------------
129 echo ----------Extracting---------------
130
131 cd %sourcepath%
132 %zipPath% x %sourcepath%\%WXFNAME%
133   del %sourcepath%\%WXFNAME%
134
135 echo -----------------------------------
136 echo ------------Boost------------------
137 echo -----------------------------------
138
139 cd %sourcepath%
140 %zipPath% x %sourcepath%\%BOOSTFNAME%
141 del %sourcepath%\%BOOSTFNAME%
142
143 echo -----------------------------------
144 echo -------------VTK-------------------
145 echo -----------------------------------
146
147 cd %sourcepath%
148 %zipPath% x %sourcepath%\%VTKFNAME%
149 del %sourcepath%\%VTKFNAME%
150
151 echo -----------------------------------
152 echo ------------GDCM ------------------
153 echo -----------------------------------
154
155 cd %sourcepath%
156 %zipPath% x %GDCMFNAME%.gz
157 %zipPath% x %GDCMFNAME%
158 del %GDCMFNAME%.gz
159 del %GDCMFNAME%
160
161 echo -----------------------------------
162 echo -------------ITK-------------------
163 echo -----------------------------------
164
165 cd %sourcepath%
166 %zipPath% x %ITKFNAME%
167 del %ITKFNAME%
168
169 echo -----------------------------------
170 echo -------------XERCES----------------
171 echo -----------------------------------
172
173 cd %sourcepath%
174 %zipPath% x %XERCESFNAME%
175 del %XERCESFNAME%
176
177 echo -----------------------------------
178 echo --------------TTH------------------
179 echo -----------------------------------
180
181 cd %sourcepath%
182 %zipPath% x %TTHFNAME%
183 del %TTHFNAME%
184
185 echo ------End TTH Installation---------
186
187 echo -----------------------------------
188
189 echo -----------------------------------
190 echo --------Renaming Folders-----------
191 echo -----------------------------------
192 cd %sourcepath%
193 rename qt-everywhere-opensource-src-4.8.2 qt
194 rename wxWidgets-%WXVERSION% wxWidgets
195 rename boost_1_49_0 boost
196 rename InsightToolkit-3.20.1 itk
197 rename VTK vtk
198 rename gdcm gdcm
199 rename tth_exe tth
200 rename xerces-c-3.1.1 xerces
201
202 echo -----End of Download Libraries-----
203 echo -----------------------------------
204 echo -----------------------------------
205
206 exit /B