Merge branch 'master' of https://github.com/celestinechen/fio
[fio.git] / os / windows / dobuild.cmd
CommitLineData
93bcfd20
BC
1@echo off\r
2setlocal enabledelayedexpansion\r
84306c1d
BC
3set /a counter=1\r
4for /f "tokens=3" %%i in (..\..\FIO-VERSION-FILE) do (\r
5 if "!counter!"=="1" set FIO_VERSION=%%i\r
6 set /a counter+=1\r
93bcfd20
BC
7)\r
8\r
3a62cbac
SW
9for /f "tokens=2 delims=-" %%i in ("%FIO_VERSION%") do (\r
10 set FIO_VERSION_NUMBERS=%%i\r
11)\r
12\r
13if not defined FIO_VERSION_NUMBERS (\r
14 echo Could not find version numbers in the string '%FIO_VERSION%'\r
15 echo Expected version to follow format 'fio-^([0-9]+.[0-9.]+^)'\r
16 goto end\r
17)\r
18\r
ea693b6e
JA
19if "%1"=="x86" set FIO_ARCH=x86\r
20if "%1"=="x64" set FIO_ARCH=x64\r
21\r
22if not defined FIO_ARCH (\r
23 echo Error: must specify the architecture.\r
24 echo Usage: dobuild x86\r
25 echo Usage: dobuild x64\r
26 goto end\r
27)\r
28\r
a478f61f
RC
29if defined SIGN_FIO (\r
30 signtool sign /n "%SIGNING_CN%" /t http://timestamp.digicert.com ..\..\fio.exe\r
31 signtool sign /as /n "%SIGNING_CN%" /tr http://timestamp.digicert.com /td sha256 /fd sha256 ..\..\fio.exe\r
32\r
33 signtool sign /n "%SIGNING_CN%" /t http://timestamp.digicert.com ..\..\t\*.exe\r
34 signtool sign /as /n "%SIGNING_CN%" /tr http://timestamp.digicert.com /td sha256 /fd sha256 ..\..\t\*.exe\r
35)\r
36\r
76bc30ca
SW
37if exist ..\..\fio.pdb (\r
38 set FIO_PDB=true\r
39) else (\r
40 set FIO_PDB=false\r
41)\r
42\r
43"%WIX%bin\candle" -nologo -arch %FIO_ARCH% -dFioVersionNumbers="%FIO_VERSION_NUMBERS%" -dFioPDB="%FIO_PDB%" install.wxs\r
93bcfd20
BC
44@if ERRORLEVEL 1 goto end\r
45"%WIX%bin\candle" -nologo -arch %FIO_ARCH% examples.wxs\r
46@if ERRORLEVEL 1 goto end\r
3277b7e4
RC
47"%WIX%bin\candle" -nologo -arch %FIO_ARCH% WixUI_Minimal_NoEULA.wxs\r
48@if ERRORLEVEL 1 goto end\r
49\r
50"%WIX%bin\light" -nologo -sice:ICE61 install.wixobj examples.wixobj WixUI_Minimal_NoEULA.wixobj -loc WixUI_fio.wxl -ext WixUIExtension -out %FIO_VERSION%-%FIO_ARCH%.msi\r
c5d72b39 51:end\r
a478f61f
RC
52\r
53if defined SIGN_FIO (\r
54 signtool sign /n "%SIGNING_CN%" /tr http://timestamp.digicert.com /td sha256 /fd sha256 %FIO_VERSION%-%FIO_ARCH%.msi\r
76bc30ca 55)\r