5 rem EXAMPLE - Build entire openIB-windows release & WIX installers (.msi) files.
\r
6 rem Binary release is constructed in WinOF\Wix\OS\bin.
\r
7 rem Processor architecture specific WIX installers are constructed
\r
10 rem BuildRelease option
\r
11 rem option: all | allnoforce | allf | compile | compilenoforce | compf path |
\r
12 rem makebin | msi |sign | wix | clean | msi-label | msi-del |
\r
13 rem msi-dir {OPENIB_REV}
\r
15 rem This script is an 'example' of a one-command entire IB stack build to
\r
16 rem single-file installer; used to build a WinOF releases.
\r
17 rem Script is designed to be invoked from the <whatever>\gen1\trunk folder with
\r
18 rem <whatever>\gen1\trunk\WinOF\Wix\* present.
\r
20 rem Verify the following env vars are suitible for your system configuration.
\r
21 rem _DDK, _PSDK, SVN, IDIR
\r
23 if "%1" == "" goto usage
\r
24 if "%1" == "/?" goto usage
\r
25 if "%1" == "-h" goto usage
\r
26 if "%1" == "all" goto OK
\r
27 if "%1" == "allnoforce" goto OK
\r
29 if "%2" == "" goto usage
\r
32 if "%1" == "compile" goto OK
\r
33 if "%1" == "compilenoforce" goto OK
\r
34 if "%1" == "compf" (
\r
35 if "%2" == "" goto usage
\r
38 if "%1" == "makebin" goto OK
\r
39 if "%1" == "msi" goto OK
\r
40 if "%1" == "sign" goto OK
\r
41 if "%1" == "wix" goto OK
\r
42 if "%1" == "clean" goto OK
\r
43 if "%1" == "msi-label" goto OK
\r
44 if "%1" == "msi-del" goto OK
\r
45 if "%1" == "msi-dir" goto OK
\r
47 echo Unknown arg '%1' ?
\r
51 echo "usage: BuildRelease command {OPENIB_REV value}"
\r
52 echo where 'command' may be:
\r
53 echo all - force recompile, install binaries to WIX tree(makebin),
\r
54 echo sign drivers and build installers.
\r
55 echo allnoforce - recompile only if needed, makebin, sign drivers and
\r
56 echo build installers.
\r
57 echo allf path - force recompile the specified folder, makebin,
\r
58 echo sign drivers and build installers.
\r
59 echo compile - force a recompile/link of everything then exit.
\r
60 echo compilenoforce - recompile/link only if needed then exit.
\r
61 echo compf path - force recompile (all arch*) specified folder
\r
62 echo makebin - assumes binaries are built, installs binaries to WIX tree
\r
64 echo msi - assumes binaries are installed in WIX tree, signs drivers and
\r
65 echo create installers (.msi files) in IDIR.
\r
66 echo sign - assumes binaries are built and installed, sign drivers, exit.
\r
67 echo wix - build .msi installers, assumes (drivers signed) .cat files exist
\r
68 echo clean - remove build artifacts for a clean build: .obj, .sys, ...
\r
69 echo msi-label {OPENIB_REV}
\r
70 echo rename WOF_os*_arch*.msi to WOF_os*_arch*_svn#.msi
\r
71 echo Uniquely identify installers just created.
\r
72 echo If OPENIB_REV arg used, then rename WOF_os*_arch*argVal.msi
\r
73 echo otherwise, use SVN# from path.
\r
74 echo msi-del - del %windir%\temp\WOF_os*_arch*.msi
\r
75 echo msi-dir - del %windir%\temp\WOF_os*_arch*.msi
\r
78 echo optional, if set then OPENIB_REV is assigned this value.
\r
79 echo example: BuildRelease all 1414
\r
85 if not "%WDM_INC_PATH%" == "" (
\r
86 echo %0: Error - %0 unable to run from WDK window,
\r
91 rem assumes %CD% == '<...>\gen1\trunk'
\r
93 set WIX=%CD%\WinOF\WIX
\r
95 rem Use Wix V2 binaries.
\r
96 rem set WIX_BIN=wix-2.0.5325.0-binaries
\r
97 set WIX_BIN=wix-2.0.5805.0-binaries
\r
99 set RBIN_W7=%WIX%\win7\bin%
\r
100 set RBIN_WLH=%WIX%\wlh\bin%
\r
101 set RBIN_WNET=%WIX%\wnet\bin%
\r
102 set RBIN_WXP=%WIX%\wxp\bin%
\r
104 rem remove build artifacts
\r
105 if "%1" == "clean" (
\r
106 echo Removing build artifacts and folders...
\r
107 call %CD%\etc\clean-build.bat
\r
108 if exist %WIX%\win7\bin (
\r
109 echo Removing %WIX%\win7\bin
\r
110 rmdir /Q /S %WIX%\win7\bin
\r
112 if exist %WIX%\wlh\bin (
\r
113 echo Removing %WIX%\wlh\bin
\r
114 rmdir /Q /S %WIX%\wlh\bin
\r
116 if exist %WIX%\wnet\bin (
\r
117 echo Removing %WIX%\wnet\bin
\r
118 rmdir /Q /S %WIX%\wnet\bin
\r
120 if exist %WIX%\wxp\bin (
\r
121 echo Removing %WIX%\wxp\bin
\r
122 rmdir /Q /S %WIX%\wxp\bin
\r
127 rem Driver Signing Certificate filename, assumes %WIX%\%CERTFILE% is valid.
\r
128 rem set CERTFILE=noCert
\r
129 set CERTFILE=MSCV-VSClass3.cer
\r
130 set SW_PUBLISHER="OpenFabrics Alliance"
\r
132 rem A Digital driver signing certificate store name may be required.
\r
134 if "%1" == "all" goto chk_cert
\r
135 if "%1" == "allf" goto chk_cert
\r
136 if "%1" == "msi" goto chk_cert
\r
137 if "%1" == "sign" goto chk_cert
\r
142 if "%CERTFILE%" == "noCert" set /P CERTFILE=[Enter Certificate FileName]
\r
143 if "%CERTFILE%" == "" (
\r
145 echo %0: Err - driver signing certificate filename required.
\r
146 echo %0: see certmgr.exe
\r
157 if "%WIN7%" == "yes" (
\r
159 set _DDK_VER=7053.0.winmain.090226-1910
\r
160 set _COIN_VER=01009
\r
162 rem Server 2008 WDK & WdfCoInstaller version
\r
163 set _DDK_VER=6001.18001
\r
164 set _COIN_VER=01007
\r
167 rem Full DDK root path
\r
168 set _DDK=%SystemDrive%\WinDDK\%_DDK_VER%
\r
170 if NOT EXIST %_DDK% (
\r
171 echo Missing WDK @ %_DDK%
\r
175 rem Platform SDK path - watchout for missing LoadPerf.h (installsp.c)
\r
176 set _PSDK=%SystemDrive%\progra~1\mi2578~1
\r
178 rem set this to be the current svn commit number; overrides svn in path
\r
179 rem processing. Additionally if set to 'latest' code expects ..\..\..\latest.txt
\r
180 rem to contain the SVN number to use.
\r
181 rem set USE_SVN=1748
\r
184 if "%1" == "allf" (
\r
188 if "%1" == "compf" (
\r
193 rem setup value for OPENIB_REV assignment; AND supported by if would be nice.
\r
194 if not "%2" == "" (
\r
195 rem set SVN commit number.
\r
203 rem Determine SVN value from current path.
\r
204 rem WARNING - SVN value depends on the path '\openIB-windows-svn\XXX\gen1',
\r
205 rem where SVN is set to XXX
\r
206 rem substring[23rd...26th] chars (offset counting) == xxxx
\r
207 rem Note - OPENIB_REV is assigned SVN in a child script.
\r
209 if "%USE_SVN%" == "" (
\r
212 if "%USE_SVN%" == "latest" (
\r
213 rem set /P SVN=<F:\openIB-windows-svn\latest.txt
\r
214 set /P SVN=< ..\..\..\latest.txt
\r
223 if NOT EXIST "%WIX%\build-all-MSI.bat" (
\r
224 echo %0 - Missing .msi installer build script
\r
225 echo %WIX%\build-all-MSI.bat
\r
229 rem WIX Installer files (.msi) destination folder - set for local environment.
\r
230 set IDIR=%SystemRoot%\temp
\r
232 if "%1" == "msi-label" (
\r
234 if exist WOF_wxp_x86.msi (
\r
235 if exist WOF_wxp_x86%LBL%.msi del /F/Q WOF_wxp_x86%LBL%.msi
\r
236 rename WOF_wxp_x86.msi WOF_wxp_x86%LBL%.msi
\r
239 if exist WOF_wnet_x86.msi (
\r
240 if exist WOF_wnet_x86%LBL%.msi del /F/Q WOF_wnet_x86%LBL%.msi
\r
241 rename WOF_wnet_x86.msi WOF_wnet_x86%LBL%.msi
\r
243 if exist WOF_wnet_x64.msi (
\r
244 if exist WOF_wnet_x64%LBL%.msi del /F/Q WOF_wnet_x64%LBL%.msi
\r
245 rename WOF_wnet_x64.msi WOF_wnet_x64%LBL%.msi
\r
247 if exist WOF_wnet_ia64.msi (
\r
248 if exist WOF_wnet_ia64%LBL%.msi del /F/Q WOF_wnet_ia64%LBL%.msi
\r
249 rename WOF_wnet_ia64.msi WOF_wnet_ia64%LBL%.msi
\r
252 if exist WOF_wlh_x86.msi (
\r
253 if exist WOF_wlh_x86%LBL%.msi del /F/Q WOF_wlh_x86%LBL%.msi
\r
254 rename WOF_wlh_x86.msi WOF_wlh_x86%LBL%.msi
\r
256 if exist WOF_wlh_x64.msi (
\r
257 if exist WOF_wlh_x64%LBL%.msi del /F/Q WOF_wlh_x64%LBL%.msi
\r
258 rename WOF_wlh_x64.msi WOF_wlh_x64%LBL%.msi
\r
260 if exist WOF_wlh_ia64.msi (
\r
261 if exist WOF_wlh_ia64%LBL%.msi del /F/Q WOF_wlh_ia64%LBL%.msi
\r
262 rename WOF_wlh_ia64.msi WOF_wlh_ia64%LBL%.msi
\r
269 if "%1" == "msi-del" (
\r
270 echo Deleting WOF_{wxp,wnet,wlh}_{x86,x64,ia64}%LBL%.msi
\r
272 if exist WOF_wxp_x86%LBL%.msi del /F/P WOF_wxp_x86%LBL%.msi
\r
274 if exist WOF_wnet_x86%LBL%.msi del /F/P WOF_wnet_x86%LBL%.msi
\r
275 if exist WOF_wnet_x64%LBL%.msi del /F/P WOF_wnet_x64%LBL%.msi
\r
276 if exist WOF_wnet_ia64%LBL%.msi del /F/P WOF_wnet_ia64%LBL%.msi
\r
278 if exist WOF_wlh_x86%LBL%.msi del /F/P WOF_wlh_x86%LBL%.msi
\r
279 if exist WOF_wlh_x64%LBL%.msi del /F/P WOF_wlh_x64%LBL%.msi
\r
280 if exist WOF_wlh_ia64%LBL%.msi del /F/P WOF_wlh_ia64%LBL%.msi
\r
282 dir /N/OD WOF_*.msi
\r
287 if "%1" == "msi-dir" (
\r
289 dir /N/OD WOF_*.msi
\r
294 echo %0 - Building with WDK @ %_DDK%
\r
295 echo Building for OPENIB_REV %SVN%, installer files (.msi) @ %IDIR%
\r
296 echo Drivers signed using Certificate '%CERTFILE%'
\r
298 rem pause thoughtfully.
\r
299 if exist %windir%\system32\timeout.exe (
\r
305 if NOT EXIST "%IDIR%" (
\r
306 echo %0 - Missing Installer file destination folder
\r
311 rem Verify WIX 2.0 toolset is available - if not, download from
\r
312 rem http://sourceforge.net/project/showfiles.php?group_id=105970&package_id=114109
\r
313 rem select wix-2.0.5805.0-binaries.zip download and unzip to
\r
314 rem <...>\gen1\trunk\WinOF\WIX\WIX_tools\
\r
316 if NOT EXIST %WIX%\WIX_tools\%WIX_BIN% (
\r
317 echo %0 - Missing WIX tools @ %WIX%\WIX_tools\%WIX_BIN%
\r
321 if NOT EXIST etc\makebin.bat (
\r
322 echo %0 - Missing etc\makebin.bat, script must run from gen1\trunk
\r
327 rem skip build - assumes binaries already built and installed.
\r
334 if "%1" == "makebin" goto InstallBin
\r
337 if "%1" == "sign" (
\r
343 if "%1" == "msi" goto do_msi_chk
\r
348 rem make sure building a msi has files to work with.
\r
349 if "%WIN7%" == "yes" (
\r
350 if not EXIST "%RBIN_W7%" goto InstallBin
\r
352 if not EXIST "%RBIN_WLH%" goto InstallBin
\r
353 if not EXIST "%RBIN_WNET%" goto InstallBin
\r
354 if not EXIST "%RBIN_WXP%" goto InstallBin
\r
360 if "%1" == "allnoforce" (
\r
361 rem Compile everything only if needed.
\r
364 if "%1" == "compilenoforce" (
\r
365 rem Compile everything only if needed.
\r
368 if "%1" == "allf" (
\r
369 rem Force Compile everything
\r
372 if "%1" == "compf" (
\r
373 rem Force Compile everything
\r
378 echo Removing build artifacts and folders...
\r
379 call %CD%\etc\clean-build.bat
\r
380 if exist %WIX%\wlh\bin (
\r
381 echo Removing %WIX%\wlh\bin
\r
382 rmdir /Q /S %WIX%\wlh\bin
\r
384 if exist %WIX%\wnet\bin (
\r
385 echo Removing %WIX%\wnet\bin
\r
386 rmdir /Q /S %WIX%\wnet\bin
\r
388 if exist %WIX%\wxp\bin (
\r
389 echo Removing %WIX%\wxp\bin
\r
390 rmdir /Q /S %WIX%\wxp\bin
\r
394 rem ************ Setup Env for Building
\r
396 set WDK_PATH=%_DDK%
\r
397 set WINOF_PATH=%CD%
\r
398 set OPENIB_REV=%SVN%
\r
399 set PLATFORM_SDK_PATH=%_PSDK%
\r
401 rem Compile in a specific folder? compf | allf
\r
402 if EXIST "%FPATH%" pushd %FPATH%
\r
404 rem ********* Compile for win7 - Windows 7
\r
406 if "%WIN7%" == "yes" (
\r
408 echo %0 - Build win7 x64 Checked
\r
409 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk x64 win7 %OPS%"
\r
410 if ERRORLEVEL 1 exit /B 1
\r
411 echo %0 - Build win7 x64 Free
\r
412 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre x64 win7 %OPS%"
\r
413 if ERRORLEVEL 1 exit /B 1
\r
416 echo %0 - Build win7 x86 Checked
\r
417 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk x86 win7 %OPS%"
\r
418 if ERRORLEVEL 1 exit /B 1
\r
419 echo %0 - Build win7 x86 Free
\r
420 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre x86 win7 %OPS%"
\r
421 if ERRORLEVEL 1 exit /B 1
\r
424 echo %0 - Build win7 ia64 Checked
\r
425 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk ia64 win7 %OPS%"
\r
426 if ERRORLEVEL 1 exit /B 1
\r
427 echo %0 - Build win7 ia64 Free
\r
428 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre ia64 win7 %OPS%"
\r
429 if ERRORLEVEL 1 exit /B 1
\r
432 rem ********* Compile for WLH - Windows Server 2008 & Vista
\r
435 echo %0 - Build WLH x64 Checked
\r
436 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk x64 2008 %OPS%"
\r
437 if ERRORLEVEL 1 exit /B 1
\r
438 echo %0 - Build WLH x64 Free
\r
439 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre x64 2008 %OPS%"
\r
440 if ERRORLEVEL 1 exit /B 1
\r
443 echo %0 - Build WLH x86 Checked
\r
444 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk x86 2008 %OPS%"
\r
445 if ERRORLEVEL 1 exit /B 1
\r
446 echo %0 - Build WLH x86 Free
\r
447 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre x86 2008 %OPS%"
\r
448 if ERRORLEVEL 1 exit /B 1
\r
451 echo %0 - Build WLH ia64 Checked
\r
452 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk ia64 2008 %OPS%"
\r
453 if ERRORLEVEL 1 exit /B 1
\r
454 echo %0 - Build WLH ia64 Free
\r
455 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre ia64 2008 %OPS%"
\r
456 if ERRORLEVEL 1 exit /B 1
\r
458 rem ********* WXP - Windows XP - x86 only
\r
460 echo %0 - Build XP x86 Checked
\r
461 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk x86 xp %OPS%"
\r
462 if ERRORLEVEL 1 exit /B 1
\r
463 echo %0 - Build XP x86 Free
\r
464 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre x86 xp %OPS%"
\r
465 if ERRORLEVEL 1 exit /B 1
\r
467 rem ********* WNET - Windows Server 2003
\r
469 echo %0 - Build WNET x64 Checked
\r
470 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk x64 2003 %OPS%"
\r
471 if ERRORLEVEL 1 exit /B 1
\r
472 echo %0 - Build WNET x64 Free
\r
473 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre x64 2003 %OPS%"
\r
474 if ERRORLEVEL 1 exit /B 1
\r
476 echo %0 - Build WNET x86 Checked
\r
477 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk x86 2003 %OPS%"
\r
478 if ERRORLEVEL 1 exit /B 1
\r
479 echo %0 - Build WNET x86 Free
\r
480 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre x86 2003 %OPS%"
\r
481 if ERRORLEVEL 1 exit /B 1
\r
483 echo %0 - Build WNET ia64 Checked
\r
484 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk ia64 2003 %OPS%"
\r
485 if ERRORLEVEL 1 exit /B 1
\r
486 echo %0 - Build WNET ia64 Free
\r
487 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre ia64 2003 %OPS%"
\r
488 if ERRORLEVEL 1 exit /B 1
\r
491 if EXIST "%FPATH%" popd
\r
493 if "%1" == "compf" goto finito
\r
494 if "%1" == "compile" goto finito
\r
495 if "%1" == "compilenoforce" goto finito
\r
497 rem Install binaries into WIX environment, build msi installers.
\r
501 echo Create binary release tree - suitible for WinOF-WIX installer build.
\r
503 if EXIST "%RBIN_W7%" (rmdir /S /Q %RBIN_W7% & echo %0 - removed %RBIN_W7%)
\r
504 if EXIST "%RBIN_WLH%" (rmdir /S /Q %RBIN_WLH% & echo %0 - removed %RBIN_WLH%)
\r
505 if EXIST "%RBIN_WNET%" (rmdir /S /Q %RBIN_WNET% & echo %0 - removed %RBIN_WNET%)
\r
506 if EXIST "%RBIN_WXP%" (rmdir /S /Q %RBIN_WXP% & echo %0 - removed %RBIN_WXP%)
\r
508 if "%WIN7%" == "yes" mkdir %RBIN_W7%
\r
513 if EXIST "%BSE%\etc\makebin.bat" (
\r
514 if "%WIN7%" == "yes" (
\r
515 call %BSE%\etc\makebin.bat %BSE% %RBIN_W7% wlh %_DDK_VER% %_COIN_VER%
\r
517 echo %0: Err in makebin.bat %BSE% %RBIN_W7% wlh
\r
521 call %BSE%\etc\makebin.bat %BSE% %RBIN_WLH% wlh %_DDK_VER% %_COIN_VER%
\r
523 echo %0: Err in makebin.bat %BSE% %RBIN_WLH% wlh
\r
526 call %BSE%\etc\makebin.bat %BSE% %RBIN_WNET% wnet %_DDK_VER% %_COIN_VER%
\r
528 echo %0: Err in makebin.bat %BSE% %RBIN_WNET% wnet
\r
531 call %BSE%\etc\makebin.bat %BSE% %RBIN_WXP% wxp %_DDK_VER% %_COIN_VER%
\r
533 echo %0: Err in makebin.bat %BSE% %RBIN_WXP% wxp
\r
538 if "%1" == "makebin" goto finito
\r
542 echo %0 - Drivers Signed with %CERTFILE%
\r
543 echo Binary releases created in
\r
544 if "%WIN7%" == "yes" echo %RBIN_W7%
\r
549 rem build WIX installers --> see WinOF\WIX
\r
551 %COMSPEC% /V:on /E:on /C "%_DDK%\bin\setenv.bat %_DDK% fre X64 WNET & cd /D %WIX% & build-all-MSI %MSI_CMD% %CERTFILE% %SW_PUBLISHER% %IDIR%"
\r
556 echo %0: Finished %0 %*
\r
557 echo %0: Started %STIME%
\r
558 echo %0: Finished %TIME%
\r