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