echo off

echo "Update S7000FC4UR FRUSDR using FRUSDR utility"
.\WinPEUtils_x64\FWPIAUPD\Devicesetup.exe -v remove *IPI0001
.\WinPEUtils_x64\FRUSDR\DeviceSetup.exe install .\WinPEUtils_x64\FRUSDR\imbdrv.inf *IMBDRV
.\WinPEUtils_x64\FRUSDR\DeviceSetup.exe install .\WinPEUtils_x64\FRUSDR\IBSMUx64.inf *IntelUtilDeV 
.\WinPEUtils_x64\FRUSDR\frusdr -cfg MASTER.CFG

echo "Update S7000FC4UR BIOS"
.\WinPEUtils_x64\IFlash32\DeviceSetup.exe -v install .\WinPEUtils_x64\IFlash32\flashud.inf *INT0800
pushd .
cd .\WinPEUtils_x64\IFlash32\
.\iflash32 /u ..\..\FXCV0033.cap /ni
popd

echo "Update S7000FC4UR BMC flash using FWPIAUPD utility"
.\WinPEUtils_x64\FWPIAUPD\DeviceSetup.exe -v install .\WinPEUtils_x64\FWPIAUPD\IMBDrv.inf *IMBDRV
.\WinPEUtils_x64\FWPIAUPD\fwpiaupd -u -o -b -pia -ni -p FCBMC23.hex


echo "Updates completed. Please reboot using the front panel button."

echo on