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
30 if exist "%2" goto OK
\r
31 echo %0 Err - path .\%2 does not exist?
\r
34 if "%1" == "compile" goto OK
\r
35 if "%1" == "compilenoforce" goto OK
\r
36 if "%1" == "compf" (
\r
37 if "%2" == "" goto usage
\r
38 if exist "%2" goto OK
\r
39 echo %0 Err - path .\%2 does not exist?
\r
42 if "%1" == "makebin" goto OK
\r
43 if "%1" == "msi" goto OK
\r
44 if "%1" == "sign" goto OK
\r
45 if "%1" == "wix" goto OK
\r
46 if "%1" == "clean" goto OK
\r
47 if "%1" == "msi-label" goto OK
\r
48 if "%1" == "msi-del" goto OK
\r
49 if "%1" == "msi-dir" goto OK
\r
51 echo Unknown arg '%1' ?
\r
55 echo "usage: BuildRelease command {OPENIB_REV value}"
\r
56 echo where 'command' may be:
\r
57 echo all - force recompile, install binaries to WIX tree(makebin),
\r
58 echo sign drivers and build installers.
\r
59 echo allnoforce - recompile only if needed, makebin, sign drivers and
\r
60 echo build installers.
\r
61 echo allf path - force recompile the specified folder, makebin,
\r
62 echo sign drivers and build installers.
\r
63 echo compile - force a recompile/link of everything then exit.
\r
64 echo compilenoforce - recompile/link only if needed then exit.
\r
65 echo compf path - force recompile (all arch*) specified folder
\r
66 echo makebin - assumes binaries are built, installs binaries to WIX tree
\r
68 echo msi - assumes binaries are installed in WIX tree, signs drivers and
\r
69 echo create installers (.msi files) in IDIR.
\r
70 echo sign - assumes binaries are built and installed, sign drivers, exit.
\r
71 echo wix - build .msi installers, assumes (drivers signed) .cat files exist
\r
72 echo clean - remove build artifacts for a clean build: .obj, .sys, ...
\r
73 echo msi-label {OPENIB_REV}
\r
74 echo rename WOF_os*_arch*.msi to WOF_os*_arch*_svn#.msi
\r
75 echo Uniquely identify installers just created.
\r
76 echo If OPENIB_REV arg used, then rename WOF_os*_arch*argVal.msi
\r
77 echo otherwise, use SVN# from path.
\r
78 echo msi-del - del %windir%\temp\WOF_os*_arch*.msi
\r
79 echo msi-dir - del %windir%\temp\WOF_os*_arch*.msi
\r
82 echo optional, if set then OPENIB_REV is assigned this value.
\r
83 echo example: BuildRelease all 1414
\r
89 if not "%WDM_INC_PATH%" == "" (
\r
90 echo %0: Error - %0 unable to run from WDK window,
\r
95 rem assumes %CD% == '<...>\gen1\trunk'
\r
97 set WIX=%CD%\WinOF\WIX
\r
99 rem Use Wix V2 binaries.
\r
100 rem set WIX_BIN=wix-2.0.5325.0-binaries
\r
101 set WIX_BIN=wix-2.0.5805.0-binaries
\r
103 set RBIN_W7=%WIX%\win7\bin%
\r
104 set RBIN_WLH=%WIX%\wlh\bin%
\r
105 set RBIN_WNET=%WIX%\wnet\bin%
\r
106 set RBIN_WXP=%WIX%\wxp\bin%
\r
108 rem remove build artifacts
\r
109 if "%1" == "clean" (
\r
110 echo Removing build artifacts and folders...
\r
111 call %CD%\etc\clean-build.bat
\r
112 if exist %WIX%\win7\bin (
\r
113 echo Removing %WIX%\win7\bin
\r
114 rmdir /Q /S %WIX%\win7\bin
\r
116 if exist %WIX%\wlh\bin (
\r
117 echo Removing %WIX%\wlh\bin
\r
118 rmdir /Q /S %WIX%\wlh\bin
\r
120 if exist %WIX%\wnet\bin (
\r
121 echo Removing %WIX%\wnet\bin
\r
122 rmdir /Q /S %WIX%\wnet\bin
\r
124 if exist %WIX%\wxp\bin (
\r
125 echo Removing %WIX%\wxp\bin
\r
126 rmdir /Q /S %WIX%\wxp\bin
\r
131 rem Driver Signing Certificate filename, assumes %WIX%\%CERTFILE% is valid.
\r
132 rem set CERTFILE=noCert
\r
133 set CERTFILE=MSCV-VSClass3.cer
\r
134 set SW_PUBLISHER="OpenFabrics Alliance"
\r
136 rem A Digital driver signing certificate store name may be required.
\r
138 if "%1" == "all" goto chk_cert
\r
139 if "%1" == "allf" goto chk_cert
\r
140 if "%1" == "msi" goto chk_cert
\r
141 if "%1" == "sign" goto chk_cert
\r
146 if "%CERTFILE%" == "noCert" set /P CERTFILE=[Enter Certificate FileName]
\r
147 if "%CERTFILE%" == "" (
\r
149 echo %0: Err - driver signing certificate filename required.
\r
150 echo %0: see certmgr.exe
\r
161 if "%WIN7%" == "yes" (
\r
163 set _DDK_VER=7068.0.0
\r
164 set _COIN_VER=01009
\r
166 rem Server 2008 WDK & WdfCoInstaller version
\r
167 set _DDK_VER=6001.18001
\r
168 set _COIN_VER=01007
\r
171 rem Full DDK root path
\r
172 set _DDK=%SystemDrive%\WinDDK\%_DDK_VER%
\r
174 if NOT EXIST %_DDK% (
\r
175 echo Missing WDK @ %_DDK%
\r
179 rem Platform SDK path - watchout for missing LoadPerf.h (installsp.c)
\r
180 set _PSDK=%SystemDrive%\progra~1\mi2578~1
\r
182 rem set this to be the current svn commit number; overrides svn in path
\r
183 rem processing. Additionally if set to 'latest' code expects ..\..\..\latest.txt
\r
184 rem to contain the SVN number to use.
\r
185 rem set USE_SVN=1748
\r
188 if "%1" == "allf" (
\r
192 if "%1" == "compf" (
\r
197 rem setup value for OPENIB_REV assignment; AND supported by if would be nice.
\r
198 if not "%2" == "" (
\r
199 rem set SVN commit number.
\r
207 rem Determine SVN value from current path.
\r
208 rem WARNING - SVN value depends on the path '\openIB-windows-svn\XXX\gen1',
\r
209 rem where SVN is set to XXX
\r
210 rem substring[23rd...26th] chars (offset counting) == xxxx
\r
211 rem Note - OPENIB_REV is assigned SVN in a child script.
\r
213 if "%USE_SVN%" == "" (
\r
216 if "%USE_SVN%" == "latest" (
\r
217 rem set /P SVN=<F:\openIB-windows-svn\latest.txt
\r
218 set /P SVN=< ..\..\..\latest.txt
\r
227 if NOT EXIST "%WIX%\build-all-MSI.bat" (
\r
228 echo %0 - Missing .msi installer build script
\r
229 echo %WIX%\build-all-MSI.bat
\r
233 rem WIX Installer files (.msi) destination folder - set for local environment.
\r
234 set IDIR=%SystemRoot%\temp
\r
236 if "%1" == "msi-label" (
\r
238 if exist WOF_wxp_x86.msi (
\r
239 if exist WOF_wxp_x86%LBL%.msi del /F/Q WOF_wxp_x86%LBL%.msi
\r
240 rename WOF_wxp_x86.msi WOF_wxp_x86%LBL%.msi
\r
243 if exist WOF_wnet_x86.msi (
\r
244 if exist WOF_wnet_x86%LBL%.msi del /F/Q WOF_wnet_x86%LBL%.msi
\r
245 rename WOF_wnet_x86.msi WOF_wnet_x86%LBL%.msi
\r
247 if exist WOF_wnet_x64.msi (
\r
248 if exist WOF_wnet_x64%LBL%.msi del /F/Q WOF_wnet_x64%LBL%.msi
\r
249 rename WOF_wnet_x64.msi WOF_wnet_x64%LBL%.msi
\r
251 if exist WOF_wnet_ia64.msi (
\r
252 if exist WOF_wnet_ia64%LBL%.msi del /F/Q WOF_wnet_ia64%LBL%.msi
\r
253 rename WOF_wnet_ia64.msi WOF_wnet_ia64%LBL%.msi
\r
256 if exist WOF_wlh_x86.msi (
\r
257 if exist WOF_wlh_x86%LBL%.msi del /F/Q WOF_wlh_x86%LBL%.msi
\r
258 rename WOF_wlh_x86.msi WOF_wlh_x86%LBL%.msi
\r
260 if exist WOF_wlh_x64.msi (
\r
261 if exist WOF_wlh_x64%LBL%.msi del /F/Q WOF_wlh_x64%LBL%.msi
\r
262 rename WOF_wlh_x64.msi WOF_wlh_x64%LBL%.msi
\r
264 if exist WOF_wlh_ia64.msi (
\r
265 if exist WOF_wlh_ia64%LBL%.msi del /F/Q WOF_wlh_ia64%LBL%.msi
\r
266 rename WOF_wlh_ia64.msi WOF_wlh_ia64%LBL%.msi
\r
273 if "%1" == "msi-del" (
\r
274 echo Deleting WOF_{wxp,wnet,wlh}_{x86,x64,ia64}%LBL%.msi
\r
276 if exist WOF_wxp_x86%LBL%.msi del /F/P WOF_wxp_x86%LBL%.msi
\r
278 if exist WOF_wnet_x86%LBL%.msi del /F/P WOF_wnet_x86%LBL%.msi
\r
279 if exist WOF_wnet_x64%LBL%.msi del /F/P WOF_wnet_x64%LBL%.msi
\r
280 if exist WOF_wnet_ia64%LBL%.msi del /F/P WOF_wnet_ia64%LBL%.msi
\r
282 if exist WOF_wlh_x86%LBL%.msi del /F/P WOF_wlh_x86%LBL%.msi
\r
283 if exist WOF_wlh_x64%LBL%.msi del /F/P WOF_wlh_x64%LBL%.msi
\r
284 if exist WOF_wlh_ia64%LBL%.msi del /F/P WOF_wlh_ia64%LBL%.msi
\r
286 dir /N/OD WOF_*.msi
\r
291 if "%1" == "msi-dir" (
\r
293 dir /N/OD WOF_*.msi
\r
298 echo %0 - Building with WDK @ %_DDK%
\r
299 echo Building for OPENIB_REV %SVN%, installer files (.msi) @ %IDIR%
\r
300 echo Drivers signed using Certificate '%CERTFILE%'
\r
302 rem pause thoughtfully.
\r
303 if exist %windir%\system32\timeout.exe (
\r
309 if NOT EXIST "%IDIR%" (
\r
310 echo %0 - Missing Installer file destination folder
\r
315 rem Verify WIX 2.0 toolset is available - if not, download from
\r
316 rem http://sourceforge.net/project/showfiles.php?group_id=105970&package_id=114109
\r
317 rem select wix-2.0.5805.0-binaries.zip download and unzip to
\r
318 rem <...>\gen1\trunk\WinOF\WIX\WIX_tools\
\r
320 if NOT EXIST %WIX%\WIX_tools\%WIX_BIN% (
\r
321 echo %0 - Missing WIX tools @ %WIX%\WIX_tools\%WIX_BIN%
\r
325 if NOT EXIST etc\makebin.bat (
\r
326 echo %0 - Missing etc\makebin.bat, script must run from gen1\trunk
\r
331 rem skip build - assumes binaries already built and installed.
\r
338 if "%1" == "makebin" goto InstallBin
\r
341 if "%1" == "sign" (
\r
347 if "%1" == "msi" goto do_msi_chk
\r
352 rem make sure building a msi has files to work with.
\r
353 if "%WIN7%" == "yes" (
\r
354 if not EXIST "%RBIN_W7%" goto InstallBin
\r
356 if not EXIST "%RBIN_WLH%" goto InstallBin
\r
357 if not EXIST "%RBIN_WNET%" goto InstallBin
\r
358 if not EXIST "%RBIN_WXP%" goto InstallBin
\r
364 if "%1" == "allnoforce" (
\r
365 rem Compile everything only if needed.
\r
368 if "%1" == "compilenoforce" (
\r
369 rem Compile everything only if needed.
\r
372 if "%1" == "allf" (
\r
373 rem Force Compile everything
\r
376 if "%1" == "compf" (
\r
377 rem Force Compile everything
\r
382 echo Removing build artifacts and folders...
\r
383 call %CD%\etc\clean-build.bat
\r
384 if exist %WIX%\wlh\bin (
\r
385 echo Removing %WIX%\wlh\bin
\r
386 rmdir /Q /S %WIX%\wlh\bin
\r
388 if exist %WIX%\wnet\bin (
\r
389 echo Removing %WIX%\wnet\bin
\r
390 rmdir /Q /S %WIX%\wnet\bin
\r
392 if exist %WIX%\wxp\bin (
\r
393 echo Removing %WIX%\wxp\bin
\r
394 rmdir /Q /S %WIX%\wxp\bin
\r
398 rem ************ Setup Env for Building
\r
400 set WDK_PATH=%_DDK%
\r
401 set WINOF_PATH=%CD%
\r
402 set OPENIB_REV=%SVN%
\r
403 set PLATFORM_SDK_PATH=%_PSDK%
\r
405 rem Compile in a specific folder? compf | allf
\r
406 if EXIST "%FPATH%" pushd %FPATH%
\r
408 rem ********* Compile for win7 - Windows 7
\r
410 if "%WIN7%" == "yes" (
\r
412 echo %0 - Build win7 x64 Checked
\r
413 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk x64 win7 %OPS%"
\r
414 if ERRORLEVEL 1 exit /B 1
\r
415 echo %0 - Build win7 x64 Free
\r
416 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre x64 win7 %OPS%"
\r
417 if ERRORLEVEL 1 exit /B 1
\r
420 echo %0 - Build win7 x86 Checked
\r
421 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk x86 win7 %OPS%"
\r
422 if ERRORLEVEL 1 exit /B 1
\r
423 echo %0 - Build win7 x86 Free
\r
424 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre x86 win7 %OPS%"
\r
425 if ERRORLEVEL 1 exit /B 1
\r
428 echo %0 - Build win7 ia64 Checked
\r
429 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk ia64 win7 %OPS%"
\r
430 if ERRORLEVEL 1 exit /B 1
\r
431 echo %0 - Build win7 ia64 Free
\r
432 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre ia64 win7 %OPS%"
\r
433 if ERRORLEVEL 1 exit /B 1
\r
436 rem ********* Compile for WLH - Windows Server 2008 & Vista
\r
439 echo %0 - Build WLH x64 Checked
\r
440 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk x64 2008 %OPS%"
\r
441 if ERRORLEVEL 1 exit /B 1
\r
442 echo %0 - Build WLH x64 Free
\r
443 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre x64 2008 %OPS%"
\r
444 if ERRORLEVEL 1 exit /B 1
\r
447 echo %0 - Build WLH x86 Checked
\r
448 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk x86 2008 %OPS%"
\r
449 if ERRORLEVEL 1 exit /B 1
\r
450 echo %0 - Build WLH x86 Free
\r
451 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre x86 2008 %OPS%"
\r
452 if ERRORLEVEL 1 exit /B 1
\r
455 echo %0 - Build WLH ia64 Checked
\r
456 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk ia64 2008 %OPS%"
\r
457 if ERRORLEVEL 1 exit /B 1
\r
458 echo %0 - Build WLH ia64 Free
\r
459 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre ia64 2008 %OPS%"
\r
460 if ERRORLEVEL 1 exit /B 1
\r
462 rem ********* WXP - Windows XP - x86 only
\r
464 echo %0 - Build XP x86 Checked
\r
465 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk x86 xp %OPS%"
\r
466 if ERRORLEVEL 1 exit /B 1
\r
467 echo %0 - Build XP x86 Free
\r
468 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre x86 xp %OPS%"
\r
469 if ERRORLEVEL 1 exit /B 1
\r
471 rem ********* WNET - Windows Server 2003
\r
473 echo %0 - Build WNET x64 Checked
\r
474 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk x64 2003 %OPS%"
\r
475 if ERRORLEVEL 1 exit /B 1
\r
476 echo %0 - Build WNET x64 Free
\r
477 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre x64 2003 %OPS%"
\r
478 if ERRORLEVEL 1 exit /B 1
\r
480 echo %0 - Build WNET x86 Checked
\r
481 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk x86 2003 %OPS%"
\r
482 if ERRORLEVEL 1 exit /B 1
\r
483 echo %0 - Build WNET x86 Free
\r
484 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre x86 2003 %OPS%"
\r
485 if ERRORLEVEL 1 exit /B 1
\r
487 echo %0 - Build WNET ia64 Checked
\r
488 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk ia64 2003 %OPS%"
\r
489 if ERRORLEVEL 1 exit /B 1
\r
490 echo %0 - Build WNET ia64 Free
\r
491 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre ia64 2003 %OPS%"
\r
492 if ERRORLEVEL 1 exit /B 1
\r
495 if EXIST "%FPATH%" popd
\r
497 if "%1" == "compf" goto finito
\r
498 if "%1" == "compile" goto finito
\r
499 if "%1" == "compilenoforce" goto finito
\r
501 rem Install binaries into WIX environment, build msi installers.
\r
505 echo Create binary release tree - suitible for WinOF-WIX installer build.
\r
507 if EXIST "%RBIN_W7%" (rmdir /S /Q %RBIN_W7% & echo %0 - removed %RBIN_W7%)
\r
508 if EXIST "%RBIN_WLH%" (rmdir /S /Q %RBIN_WLH% & echo %0 - removed %RBIN_WLH%)
\r
509 if EXIST "%RBIN_WNET%" (rmdir /S /Q %RBIN_WNET% & echo %0 - removed %RBIN_WNET%)
\r
510 if EXIST "%RBIN_WXP%" (rmdir /S /Q %RBIN_WXP% & echo %0 - removed %RBIN_WXP%)
\r
512 if "%WIN7%" == "yes" mkdir %RBIN_W7%
\r
517 if EXIST "%BSE%\etc\makebin.bat" (
\r
518 if "%WIN7%" == "yes" (
\r
519 call %BSE%\etc\makebin.bat %BSE% %RBIN_W7% wlh %_DDK_VER% %_COIN_VER%
\r
521 echo %0: Err in makebin.bat %BSE% %RBIN_W7% wlh
\r
525 call %BSE%\etc\makebin.bat %BSE% %RBIN_WLH% wlh %_DDK_VER% %_COIN_VER%
\r
527 echo %0: Err in makebin.bat %BSE% %RBIN_WLH% wlh
\r
530 call %BSE%\etc\makebin.bat %BSE% %RBIN_WNET% wnet %_DDK_VER% %_COIN_VER%
\r
532 echo %0: Err in makebin.bat %BSE% %RBIN_WNET% wnet
\r
535 call %BSE%\etc\makebin.bat %BSE% %RBIN_WXP% wxp %_DDK_VER% %_COIN_VER%
\r
537 echo %0: Err in makebin.bat %BSE% %RBIN_WXP% wxp
\r
542 if "%1" == "makebin" goto finito
\r
546 echo %0 - Drivers Signed with %CERTFILE%
\r
547 echo Binary releases created in
\r
548 if "%WIN7%" == "yes" echo %RBIN_W7%
\r
553 rem build WIX installers --> see WinOF\WIX
\r
555 %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
560 echo %0: Finished %0 %*
\r
561 echo %0: Started %STIME%
\r
562 echo %0: Finished %TIME%
\r