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
166 if "%1" == "msi-label" (
\r
168 if exist WOF_wxp_x86.msi (
\r
169 if exist WOF_wxp_x86%LBL%.msi del /F/Q WOF_wxp_x86%LBL%.msi
\r
170 rename WOF_wxp_x86.msi WOF_wxp_x86%LBL%.msi
\r
173 if exist WOF_wnet_x86.msi (
\r
174 if exist WOF_wnet_x86%LBL%.msi del /F/Q WOF_wnet_x86%LBL%.msi
\r
175 rename WOF_wnet_x86.msi WOF_wnet_x86%LBL%.msi
\r
177 if exist WOF_wnet_x64.msi (
\r
178 if exist WOF_wnet_x64%LBL%.msi del /F/Q WOF_wnet_x64%LBL%.msi
\r
179 rename WOF_wnet_x64.msi WOF_wnet_x64%LBL%.msi
\r
181 if exist WOF_wnet_ia64.msi (
\r
182 if exist WOF_wnet_ia64%LBL%.msi del /F/Q WOF_wnet_ia64%LBL%.msi
\r
183 rename WOF_wnet_ia64.msi WOF_wnet_ia64%LBL%.msi
\r
186 if exist WOF_wlh_x86.msi (
\r
187 if exist WOF_wlh_x86%LBL%.msi del /F/Q WOF_wlh_x86%LBL%.msi
\r
188 rename WOF_wlh_x86.msi WOF_wlh_x86%LBL%.msi
\r
190 if exist WOF_wlh_x64.msi (
\r
191 if exist WOF_wlh_x64%LBL%.msi del /F/Q WOF_wlh_x64%LBL%.msi
\r
192 rename WOF_wlh_x64.msi WOF_wlh_x64%LBL%.msi
\r
194 if exist WOF_wlh_ia64.msi (
\r
195 if exist WOF_wlh_ia64%LBL%.msi del /F/Q WOF_wlh_ia64%LBL%.msi
\r
196 rename WOF_wlh_ia64.msi WOF_wlh_ia64%LBL%.msi
\r
203 if "%1" == "msi-del" (
\r
204 echo Deleting WOF_{wxp,wnet,wlh}_{x86,x64,ia64}%LBL%.msi
\r
206 if exist WOF_wxp_x86%LBL%.msi del /F/P WOF_wxp_x86%LBL%.msi
\r
208 if exist WOF_wnet_x86%LBL%.msi del /F/P WOF_wnet_x86%LBL%.msi
\r
209 if exist WOF_wnet_x64%LBL%.msi del /F/P WOF_wnet_x64%LBL%.msi
\r
210 if exist WOF_wnet_ia64%LBL%.msi del /F/P WOF_wnet_ia64%LBL%.msi
\r
212 if exist WOF_wlh_x86%LBL%.msi del /F/P WOF_wlh_x86%LBL%.msi
\r
213 if exist WOF_wlh_x64%LBL%.msi del /F/P WOF_wlh_x64%LBL%.msi
\r
214 if exist WOF_wlh_ia64%LBL%.msi del /F/P WOF_wlh_ia64%LBL%.msi
\r
216 dir /N/OD WOF_*.msi
\r
221 if "%1" == "msi-dir" (
\r
223 dir /N/OD WOF_*.msi
\r
228 echo %0 - Building with WDK @ %_DDK%
\r
229 echo Building for OPENIB_REV %SVN%, installer files (.msi) @ %IDIR%
\r
230 echo Drivers signed using Certificate '%CERTFILE%'
\r
232 rem pause thoughtfully.
\r
233 if exist %windir%\system32\timeout.exe (
\r
239 if NOT EXIST "%IDIR%" (
\r
240 echo %0 - Missing Installer file destination folder %IDIR%
\r
244 rem Verify WIX 2.0 toolset is available - if not, download from
\r
245 rem http://sourceforge.net/project/showfiles.php?group_id=105970&package_id=114109
\r
246 rem select wix-2.0.5805.0-binaries.zip download and unzip to
\r
247 rem <...>\gen1\trunk\WinOF\WIX\WIX_tools\
\r
249 if NOT EXIST %WIX%\WIX_tools\%WIX_BIN% (
\r
250 echo %0 - Missing WIX tools @ %WIX%\WIX_tools\%WIX_BIN%
\r
254 if NOT EXIST etc\makebin.bat (
\r
255 echo %0 - Missing etc\makebin.bat, script must run from gen1\trunk
\r
260 rem skip build - assumes binaries already built.
\r
269 if not EXIST "%RBIN_WLH%" goto InstallBin
\r
270 if not EXIST "%RBIN_WNET%" goto InstallBin
\r
271 if not EXIST "%RBIN_WXP%" goto InstallBin
\r
275 if "%1" == "makebin" goto InstallBin
\r
278 if "%1" == "allnoforce" (
\r
279 rem Compile everything only if needed.
\r
282 if "%1" == "compilenoforce" (
\r
283 rem Compile everything only if needed.
\r
288 echo Removing build artifacts and folders...
\r
289 call %CD%\etc\clean-build.bat
\r
292 rem ************ Setup Env for Building
\r
294 set WDK_PATH=%_DDK%
\r
295 set WINOF_PATH=%CD%
\r
296 set OPENIB_REV=%SVN%
\r
297 set PLATFORM_SDK_PATH=%_PSDK%
\r
299 rem ********* Compile for WLH - Windows Server 2008 & Vista
\r
301 echo %0 - Build WLH x64 Checked
\r
302 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk x64 2008 %OPS%"
\r
303 if ERRORLEVEL 1 exit /B 1
\r
304 echo %0 - Build WLH x64 Free
\r
305 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre x64 2008 %OPS%"
\r
306 if ERRORLEVEL 1 exit /B 1
\r
310 echo %0 - Build WLH x86 Checked
\r
311 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk x86 2008 %OPS%"
\r
312 if ERRORLEVEL 1 exit /B 1
\r
313 echo %0 - Build WLH x86 Free
\r
314 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre x86 2008 %OPS%"
\r
315 if ERRORLEVEL 1 exit /B 1
\r
318 echo %0 - Build WLH ia64 Checked
\r
319 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk ia64 2008 %OPS%"
\r
320 if ERRORLEVEL 1 exit /B 1
\r
321 echo %0 - Build WLH ia64 Free
\r
322 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre ia64 2008 %OPS%"
\r
323 if ERRORLEVEL 1 exit /B 1
\r
326 rem ********* WXP - Windows XP - x86 only
\r
328 echo %0 - Build XP x86 Checked
\r
329 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk x86 xp %OPS%"
\r
330 if ERRORLEVEL 1 exit /B 1
\r
332 echo %0 - Build XP x86 Free
\r
333 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre x86 xp %OPS%"
\r
334 if ERRORLEVEL 1 exit /B 1
\r
337 rem ********* WNET - Windows Server 2003
\r
338 echo %0 - Build WNET x64 Checked
\r
339 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk x64 2003 %OPS%"
\r
340 if ERRORLEVEL 1 exit /B 1
\r
341 echo %0 - Build WNET x64 Free
\r
342 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre x64 2003 %OPS%"
\r
343 if ERRORLEVEL 1 exit /B 1
\r
345 echo %0 - Build WNET x86 Checked
\r
346 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk x86 2003 %OPS%"
\r
347 if ERRORLEVEL 1 exit /B 1
\r
348 echo %0 - Build WNET x86 Free
\r
349 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre x86 2003 %OPS%"
\r
350 if ERRORLEVEL 1 exit /B 1
\r
352 echo %0 - Build WNET ia64 Checked
\r
353 %COMSPEC% /C "call %BSE%\etc\bldwo.bat chk ia64 2003 %OPS%"
\r
354 if ERRORLEVEL 1 exit /B 1
\r
355 echo %0 - Build WNET ia64 Free
\r
356 %COMSPEC% /C "call %BSE%\etc\bldwo.bat fre ia64 2003 %OPS%"
\r
357 if ERRORLEVEL 1 exit /B 1
\r
359 if "%1" == "compile" goto finito
\r
360 if "%1" == "compilenoforce" goto finito
\r
362 rem Install binaries into WIX environment, build msi installers.
\r
366 echo Create binary release tree - suitible for WinOF-WIX installer build.
\r
368 if EXIST "%RBIN_WLH%" (rmdir /S /Q %RBIN_WLH% & echo %0 - removed %RBIN_WLH%)
\r
369 if EXIST "%RBIN_WNET%" (rmdir /S /Q %RBIN_WNET% & echo %0 - removed %RBIN_WNET%)
\r
370 if EXIST "%RBIN_WXP%" (rmdir /S /Q %RBIN_WXP% & echo %0 - removed %RBIN_WXP%)
\r
376 if EXIST "%BSE%\etc\makebin.bat" (
\r
377 call %BSE%\etc\makebin.bat %BSE% %RBIN_WLH% wlh
\r
379 echo %0: Err in makebin.bat %BSE% %RBIN_WLH% wlh
\r
382 call %BSE%\etc\makebin.bat %BSE% %RBIN_WNET% wnet
\r
384 echo %0: Err in makebin.bat %BSE% %RBIN_WNET% wnet
\r
387 call %BSE%\etc\makebin.bat %BSE% %RBIN_WXP% wxp
\r
389 echo %0: Err in makebin.bat %BSE% %RBIN_WXP% wxp
\r
394 if "%1" == "makebin" goto finito
\r
398 echo %0 - Drivers Signed with %CERTFILE%
\r
399 echo Binary releases created in
\r
404 rem build WIX installers --> see WinOF\WIX
\r
406 %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
412 echo %0: Finished %0 %*
\r
413 echo %0: Started %STIME%
\r
414 echo %0: Finished %TIME%
\r