@echo off
REM Build Complexx MSI Installer
REM Requires: WiX Toolset 3.x installed (https://wixtoolset.org/)
REM Run from the installer\ directory

set WIX_BIN="C:\Program Files (x86)\WiX Toolset v3.14\bin"

echo [1/2] Compiling MSI manifest...
%WIX_BIN%\candle.exe -nologo -ext WixUIExtension -dProjectDir=..\..\ complexx.wxs -out complexx.wixobj
if %ERRORLEVEL% neq 0 (
    echo FAILED: candle.exe
    exit /b 1
)

echo [2/2] Linking MSI...
%WIX_BIN%\light.exe -nologo -ext WixUIExtension -spdb -out ..\ComplexxRaycaster.msi complexx.wixobj
if %ERRORLEVEL% neq 0 (
    echo FAILED: light.exe
    exit /b 1
)

echo.
echo Done! Installer: ..\ComplexxRaycaster.msi
