windows: minor windows installer improvements
[fio.git] / os / windows / dobuild.cmd
index fd54a9c670888bdf7e0f123cd55c7b6eb151c8ef..ef12d82d7a36c8eabdf9e8716ce782b3acc84a64 100644 (file)
@@ -6,6 +6,16 @@ for /f "tokens=3" %%i in (..\..\FIO-VERSION-FILE) do (
  set /a counter+=1\r
 )\r
 \r
  set /a counter+=1\r
 )\r
 \r
+for /f "tokens=2 delims=-" %%i in ("%FIO_VERSION%") do (\r
+ set FIO_VERSION_NUMBERS=%%i\r
+)\r
+\r
+if not defined FIO_VERSION_NUMBERS (\r
+  echo Could not find version numbers in the string '%FIO_VERSION%'\r
+  echo Expected version to follow format 'fio-^([0-9]+.[0-9.]+^)'\r
+  goto end\r
+)\r
+\r
 if "%1"=="x86" set FIO_ARCH=x86\r
 if "%1"=="x64" set FIO_ARCH=x64\r
 \r
 if "%1"=="x86" set FIO_ARCH=x86\r
 if "%1"=="x64" set FIO_ARCH=x64\r
 \r
@@ -16,7 +26,7 @@ if not defined FIO_ARCH (
   goto end\r
 )\r
 \r
   goto end\r
 )\r
 \r
-"%WIX%bin\candle" -nologo -arch %FIO_ARCH% install.wxs\r
+"%WIX%bin\candle" -nologo -arch %FIO_ARCH% -dFioVersionNumbers="%FIO_VERSION_NUMBERS%" install.wxs\r
 @if ERRORLEVEL 1 goto end\r
 "%WIX%bin\candle" -nologo -arch %FIO_ARCH% examples.wxs\r
 @if ERRORLEVEL 1 goto end\r
 @if ERRORLEVEL 1 goto end\r
 "%WIX%bin\candle" -nologo -arch %FIO_ARCH% examples.wxs\r
 @if ERRORLEVEL 1 goto end\r