4 rem EXAMPLE - Build entire openIB-windows release & WIX installers (.msi) files.
\r
5 rem Binary release is constructed in WinOF\Wix\OS\bin.
\r
6 rem Processor architecture specific WIX installers are constructed
\r
9 rem BuildRelease option
\r
10 rem option == all | allnoforce | compile | compilenoforce | makebin | msi |
\r
11 rem wix | clean | msi-label | msi-del | msi-dir {OPENIB_REV}
\r
13 rem This script is an 'example' of a one-command entire IB stack build to
\r
14 rem single-file installer; used to build a WinOF releases.
\r
15 rem Script is designed to be invoked from the <whatever>\gen1\trunk folder with
\r
16 rem <whatever>\gen1\trunk\WinOF\Wix\* present.
\r
18 rem Verify the following env vars are suitible for your system configuration.
\r
19 rem _DDK, _PSDK, SVN, IDIR
\r
21 if "%1" == "" goto usage
\r
22 if "%1" == "/?" goto usage
\r
23 if "%1" == "-h" goto usage
\r
24 if "%1" == "all" goto OK
\r
25 if "%1" == "allnoforce" goto OK
\r
26 if "%1" == "compile" goto OK
\r
27 if "%1" == "compilenoforce" goto OK
\r
28 if "%1" == "makebin" goto OK
\r
29 if "%1" == "msi" goto OK
\r
30 if "%1" == "wix" goto OK
\r
31 if "%1" == "clean" goto OK
\r
32 if "%1" == "msi-label" goto OK
\r
33 if "%1" == "msi-del" goto OK
\r
34 if "%1" == "msi-dir" goto OK
\r
36 echo Unknown arg '%1' ?
\r
40 echo "usage: BuildRelease command {OPENIB_REV value}"
\r
41 echo where 'command' may be:
\r
42 echo all - force recompile, install binaries to WIX tree, sign drivers and
\r
43 echo build installers.
\r
45 echo allnoforce - recompile only if needed, install binaries to WIX tree,
\r
46 echo sign drivers and build installers.
\r
47 echo compile - force a recompile/link of everything then exit.
\r
48 echo compilenoforce - recompile/link only if needed then exit.
\r
49 echo makebin - assumes binaries are built, will installs binaries to WIX tree
\r
51 echo msi - assumes binaries are installed in WIX tree, signs drivers and
\r
52 echo create installers (.msi files) in IDIR.
\r
53 echo wix - build .msi installers, assumes (drivers signed) .cat files exist
\r
54 echo clean - remove build artifacts for a clean build: .obj, .sys, ...
\r
55 echo msi-label {OPENIB_REV}
\r
56 echo rename WOF_os*_arch*.msi to WOF_os*_arch*_svn#.msi
\r
57 echo Uniquely identify installers just created.
\r
58 echo If OPENIB_REV arg used, then rename WOF_os*_arch*argVal.msi
\r
59 echo otherwise, use SVN# from path.
\r
60 echo msi-del - del %windir%\temp\WOF_os*_arch*.msi
\r
61 echo msi-dir - del %windir%\temp\WOF_os*_arch*.msi
\r
64 echo optional, if set then OPENIB_REV is assigned this value.
\r
65 echo example: BuildRelease all 1414
\r
71 if not "%WDM_INC_PATH%" == "" (
\r
72 echo %0: Error - %0 unable to run from WDK window,
\r
77 rem remove build artifacts
\r
78 if "%1" == "clean" (
\r
79 echo Removing build artifacts and folders...
\r
80 call %CD%\etc\clean-build.bat
\r
84 rem Driver Signing Certificate filename, assumes %WIX%\%CERTFILE% is valid.
\r
85 rem set CERTFILE=noCert
\r
86 set CERTFILE=MSCV-VSClass3.cer
\r
87 set CERTSNAME="OpenFabrics Alliance"
\r
89 rem A Digital driver signing certificate store name may be required.
\r
91 if "%CERTFILE%" == "noCert" set /P CERTFILE=[Enter Certificate FileName]
\r
92 if "%CERTFILE%" == "" (
\r
94 echo %0: Err - driver signing certificate filename required.
\r
95 echo %0: see certmgr.exe
\r
101 if "%CERTFILE%" == "noCert" set /P CERTFILE=[Enter Certificate FileName]
\r
102 if "%CERTFILE%" == "" (
\r
104 echo %0: Err - driver signing certificate filename required.
\r
105 echo %0: see certmgr.exe
\r
112 set _DDK=%SystemDrive%\WinDDK\6001.18001
\r
114 if NOT EXIST %_DDK% (
\r
115 echo Missing WDK @ %_DDK%
\r
119 rem Platform SDK path - watchout for missing LoadPerf.h (installsp.c)
\r
120 set _PSDK=%SystemDrive%\progra~1\mi2578~1
\r
122 rem set this to be the current svn commit number; overrides svn in path
\r
126 rem setup value for OPENIB_REV assignment.
\r
128 rem Determine SVN value from current path.
\r
129 rem WARNING - SVN value depends on the path '\openIB-windows-svn\XXX\gen1',
\r
130 rem where SVN is set to XXX
\r
131 rem substring[23rd...26th] chars (offset counting) == xxxx
\r
132 rem Note - OPENIB_REV is assigned SVN in a child script.
\r
134 if "%USE_SVN%" == "" (
\r
145 rem assumes %CD% == '<...>\gen1\trunk'
\r
147 set WIX=%CD%\WinOF\WIX
\r
149 rem Use Wix V2 binaries.
\r
150 rem set WIX_BIN=wix-2.0.5325.0-binaries
\r
151 set WIX_BIN=wix-2.0.5805.0-binaries
\r
153 set RBIN_WLH=%WIX%\wlh\bin%
\r
154 set RBIN_WNET=%WIX%\wnet\bin%
\r
155 set RBIN_WXP=%WIX%\wxp\bin%
\r
157 if NOT EXIST "%WIX%\build-all-MSI.bat" (
\r
158 echo %0 - Missing .msi installer build script
\r
159 echo %WIX%\build-all-MSI.bat
\r
163 rem WIX Installer files (.msi) destination folder - set for local environment.
\r
164 set IDIR=%SystemRoot%\temp
\r
167 if "%1" == "msi-label" (
\r
169 if exist WOF_wxp_x86.msi (
\r
170 if exist WOF_wxp_x86%LBL%.msi del /F/Q WOF_wxp_x86%LBL%.msi
\r
171 rename WOF_wxp_x86.msi WOF_wxp_x86%LBL%.msi
\r
174 if exist WOF_wnet_x86.msi (
\r
175 if exist WOF_wnet_x86%LBL%.msi del /F/Q WOF_wnet_x86%LBL%.msi
\r
176 rename WOF_wnet_x86.msi WOF_wnet_x86%LBL%.msi
\r
178 if exist WOF_wnet_x64.msi (
\r
179 if exist WOF_wnet_x64%LBL%.msi del /F/Q WOF_wnet_x64%LBL%.msi
\r
180 rename WOF_wnet_x64.msi WOF_wnet_x64%LBL%.msi
\r
182 if exist WOF_wnet_ia64.msi (
\r
183 if exist WOF_wnet_ia64%LBL%.msi del /F/Q WOF_wnet_ia64%LBL%.msi
\r
184 rename WOF_wnet_ia64.msi WOF_wnet_ia64%LBL%.msi
\r
187 if exist WOF_wlh_x86.msi (
\r
188 if exist WOF_wlh_x86%LBL%.msi del /F/Q WOF_wlh_x86%LBL%.msi
\r
189 rename WOF_wlh_x86.msi WOF_wlh_x86%LBL%.msi
\r
191 if exist WOF_wlh_x64.msi (
\r
192 if exist WOF_wlh_x64%LBL%.msi del /F/Q WOF_wlh_x64%LBL%.msi
\r
193 rename WOF_wlh_x64.msi WOF_wlh_x64%LBL%.msi
\r
195 if exist WOF_wlh_ia64.msi (
\r
196 if exist WOF_wlh_ia64%LBL%.msi del /F/Q WOF_wlh_ia64%LBL%.msi
\r
197 rename WOF_wlh_ia64.msi WOF_wlh_ia64%LBL%.msi
\r
204 if "%1" == "msi-del" (
\r
205 echo Deleting WOF_{wxp,wnet,wlh}_{x86,x64,ia64}%LBL%.msi
\r
207 if exist WOF_wxp_x86%LBL%.msi del /F/P WOF_wxp_x86%LBL%.msi
\r
209 if exist WOF_wnet_x86%LBL%.msi del /F/P WOF_wnet_x86%LBL%.msi
\r
210 if exist WOF_wnet_x64%LBL%.msi del /F/P WOF_wnet_x64%LBL%.msi
\r
211 if exist WOF_wnet_ia64%LBL%.msi del /F/P WOF_wnet_ia64%LBL%.msi
\r
213 if exist WOF_wlh_x86%LBL%.msi del /F/P WOF_wlh_x86%LBL%.msi
\r
214 if exist WOF_wlh_x64%LBL%.msi del /F/P WOF_wlh_x64%LBL%.msi
\r
215 if exist WOF_wlh_ia64%LBL%.msi del /F/P WOF_wlh_ia64%LBL%.msi
\r
217 dir /N/OD WOF_*.msi
\r
222 if "%1" == "msi-dir" (
\r
224 dir /N/OD WOF_*.msi
\r
229 echo %0 - Building with WDK @ %_DDK%
\r
230 echo Building for OPENIB_REV %SVN%, installer files @ %IDIR%
\r
231 echo Drivers signed using Certificate '%CERTFILE%'
\r
233 rem pause thoughtfully.
\r
234 if exist %windir%\system32\timeout.exe (
\r
240 if NOT EXIST "%IDIR%" (
\r
241 echo %0 - Missing Installer file destination folder %IDIR%
\r
245 rem Verify WIX 2.0 toolset is available - if not, download from
\r
246 rem http://sourceforge.net/project/showfiles.php?group_id=105970&package_id=114109
\r
247 rem select wix-2.0.5805.0-binaries.zip download and unzip to
\r
248 rem <...>\gen1\trunk\WinOF\WIX\WIX_tools\
\r
250 if NOT EXIST %WIX%\WIX_tools\%WIX_BIN% (
\r
251 echo %0 - Missing WIX tools @ %WIX%\WIX_tools\%WIX_BIN%
\r
255 if NOT EXIST etc\makebin.bat (
\r
256 echo %0 - Missing etc\makebin.bat, script must run from gen1\trunk
\r
261 rem skip build - assumes binaries already built.
\r
270 if not EXIST "%RBIN_WLH%" goto InstallBin
\r
271 if not EXIST "%RBIN_WNET%" goto InstallBin
\r
272 if not EXIST "%RBIN_WXP%" goto InstallBin
\r
276 if "%1" == "makebin" goto InstallBin
\r
279 if "%1" == "allnoforce" (
\r
280 rem Compile everything only if needed.
\r
283 if "%1" == "compilenoforce" (
\r
284 rem Compile everything only if needed.
\r
289 echo Removing build artifacts and folders...
\r
290 call %CD%\etc\clean-build.bat
\r
293 rem ********* Compile for WLH - Windows Server 2008 & Vista
\r
296 echo %0 - Build WLH x64 Checked
\r
297 %COMSPEC% /C "call %BSE%\etc\IB_CHK_BLD_x64.bat %SVN% %CD% %_DDK% %_PSDK% WLH & build %OPS%"
\r
298 if ERRORLEVEL 1 exit /B 1
\r
299 echo %0 - Build WLH x64 Free
\r
300 %COMSPEC% /C "call %BSE%\etc\IB_FRE_BLD_x64.bat %SVN% %CD% %_DDK% %_PSDK% WLH & build %OPS%"
\r
301 if ERRORLEVEL 1 exit /B 1
\r
305 echo %0 - Build WLH x86 Checked
\r
306 %COMSPEC% /C "call %BSE%\etc\IB_CHK_BLD_x86.bat %SVN% %CD% %_DDK% %_PSDK% WLH & build %OPS%"
\r
307 if ERRORLEVEL 1 exit /B 1
\r
308 echo %0 - Build WLH x86 Free
\r
309 %COMSPEC% /C "call %BSE%\etc\IB_FRE_BLD_x86.bat %SVN% %CD% %_DDK% %_PSDK% WLH & build %OPS%"
\r
310 if ERRORLEVEL 1 exit /B 1
\r
313 echo %0 - Build WLH ia64 Checked
\r
314 %COMSPEC% /C "call %BSE%\etc\IB_CHK_BLD_IA64.bat %SVN% %CD% %_DDK% %_PSDK% WLH & build %OPS%"
\r
315 if ERRORLEVEL 1 exit /B 1
\r
316 echo %0 - Build WLH ia64 Free
\r
317 %COMSPEC% /C "call %BSE%\etc\IB_FRE_BLD_IA64.bat %SVN% %CD% %_DDK% %_PSDK% WLH & build %OPS%"
\r
318 if ERRORLEVEL 1 exit /B 1
\r
321 rem ********* WXP - Windows XP - x86 only
\r
323 echo %0 - Build XP x86 Checked
\r
324 %COMSPEC% /C "call %BSE%\etc\IB_CHK_BLD_x86.bat %SVN% %CD% %_DDK% %_PSDK% WXP & build %OPS%"
\r
325 if ERRORLEVEL 1 exit /B 1
\r
327 echo %0 - Build XP x86 Free
\r
328 %COMSPEC% /C "call %BSE%\etc\IB_FRE_BLD_x86.bat %SVN% %CD% %_DDK% %_PSDK% WXP & build %OPS%"
\r
329 if ERRORLEVEL 1 exit /B 1
\r
332 rem ********* WNET - Windows Server 2003
\r
333 echo %0 - Build WNET x64 Checked
\r
334 %COMSPEC% /C "call %BSE%\etc\IB_CHK_BLD_x64.bat %SVN% %CD% %_DDK% %_PSDK% WNET & build %OPS%"
\r
335 if ERRORLEVEL 1 exit /B 1
\r
336 echo %0 - Build WNET x64 Free
\r
337 %COMSPEC% /C "call %BSE%\etc\IB_FRE_BLD_x64.bat %SVN% %CD% %_DDK% %_PSDK% WNET & build %OPS%"
\r
338 if ERRORLEVEL 1 exit /B 1
\r
340 echo %0 - Build WNET x86 Checked
\r
341 %COMSPEC% /C "call %BSE%\etc\IB_CHK_BLD_x86.bat %SVN% %CD% %_DDK% %_PSDK% WNET & build %OPS%"
\r
342 if ERRORLEVEL 1 exit /B 1
\r
343 echo %0 - Build WNET x86 Free
\r
344 %COMSPEC% /C "call %BSE%\etc\IB_FRE_BLD_x86.bat %SVN% %CD% %_DDK% %_PSDK% WNET & build %OPS%"
\r
345 if ERRORLEVEL 1 exit /B 1
\r
347 echo %0 - Build WNET ia64 Checked
\r
348 %COMSPEC% /C "call %BSE%\etc\IB_CHK_BLD_IA64.bat %SVN% %CD% %_DDK% %_PSDK% WNET & build %OPS%"
\r
349 if ERRORLEVEL 1 exit /B 1
\r
350 echo %0 - Build WNET ia64 Free
\r
351 %COMSPEC% /C "call %BSE%\etc\IB_FRE_BLD_IA64.bat %SVN% %CD% %_DDK% %_PSDK% WNET & build %OPS%"
\r
352 if ERRORLEVEL 1 exit /B 1
\r
354 if "%1" == "compile" goto finito
\r
355 if "%1" == "compilenoforce" goto finito
\r
357 rem Install binaries into WIX environment, build msi installers.
\r
361 echo Create binary release tree - suitible for WinOF-WIX installer build.
\r
363 if EXIST "%RBIN_WLH%" (rmdir /S /Q %RBIN_WLH% & echo %0 - removed %RBIN_WLH%)
\r
364 if EXIST "%RBIN_WNET%" (rmdir /S /Q %RBIN_WNET% & echo %0 - removed %RBIN_WNET%)
\r
365 if EXIST "%RBIN_WXP%" (rmdir /S /Q %RBIN_WXP% & echo %0 - removed %RBIN_WXP%)
\r
371 if EXIST "%BSE%\etc\makebin.bat" (
\r
372 call %BSE%\etc\makebin.bat %BSE% %RBIN_WLH% wlh
\r
374 echo %0: Err in makebin.bat %BSE% %RBIN_WLH% wlh
\r
377 call %BSE%\etc\makebin.bat %BSE% %RBIN_WNET% wnet
\r
379 echo %0: Err in makebin.bat %BSE% %RBIN_WNET% wnet
\r
382 call %BSE%\etc\makebin.bat %BSE% %RBIN_WXP% wxp
\r
384 echo %0: Err in makebin.bat %BSE% %RBIN_WXP% wxp
\r
389 if "%1" == "makebin" goto finito
\r
393 echo %0 - Drivers Signed with %CERTFILE%
\r
394 echo Binary releases created in
\r
399 rem build WIX installers --> see WinOF\WIX
\r
401 %COMSPEC% /V:on /E:on /C "%_DDK%\bin\setenv.bat %_DDK% fre X64 WNET & cd /D %WIX% & build-all-MSI %MSI_CMD% %CERTFILE% %CERTSNAME% %IDIR%"
\r
407 echo %0: Finished %0 %*
\r
408 echo %0: Started %STIME%
\r
409 echo %0: Finished %TIME%
\r