43e5db4dad43f581e21a7da3483192d4124d0e96
[fio.git] / os / windows / dobuild.cmd
1 @echo off\r
2 setlocal enabledelayedexpansion\r
3 set /a counter=4\r
4 for /f "tokens=3" %%i in (..\..\fio_version.h) do (\r
5  if "!counter!"=="4" set FIO_MAJOR=%%i\r
6  if "!counter!"=="5" set FIO_MINOR=%%i\r
7  if "!counter!"=="6" set FIO_PATCH=%%i\r
8 set /a counter+=1\r
9 )\r
10 \r
11 if "%1"=="x86" set FIO_ARCH=x86\r
12 if "%1"=="x64" set FIO_ARCH=x64\r
13 \r
14 if not defined FIO_ARCH (\r
15   echo Error: must specify the architecture.\r
16   echo Usage: dobuild x86\r
17   echo Usage: dobuild x64\r
18   goto end\r
19 )\r
20 \r
21 "%WIX%bin\candle" -nologo -arch %FIO_ARCH% install.wxs\r
22 @if ERRORLEVEL 1 goto end\r
23 "%WIX%bin\candle" -nologo -arch %FIO_ARCH% examples.wxs\r
24 @if ERRORLEVEL 1 goto end\r
25 "%WIX%bin\light" -nologo install.wixobj examples.wixobj -ext WixUIExtension -out fio-%FIO_MAJOR%.%FIO_MINOR%.%FIO_PATCH%-%FIO_ARCH%.msi\r
26 :end