@echo off
cls
REM ******************************************************************************
REM Copyright (c) 2011, Intel Corporation.
REM This System Configuration Utility is furnished under license and may only be 
REM used or copied in accordance with the terms of that license. No license, express 
REM or implied, by estoppel or otherwise, to any intellectual property rights is 
REM granted by this document. The Software is subject to change without notice, and 
REM should not be construed as a commitment by Intel Corporation to market, 
REM license, sell or support any product or technology. Unless otherwise provided for 
REM in the license under which this Software is provided, the Software is provided AS 
REM IS, with no warranties of any kind, express or implied. Except as expressly 
REM permitted by the Software license, neither Intel Corporation nor its suppliers 
REM assumes any responsibility or liability for any errors or inaccuracies that may 
REM appear herein. Except as expressly permitted by the Software license, no part of
REM the Software may be reproduced, stored in a retrieval system, transmitted in any 
REM form, or distributed by any means without the express written consent of Intel 
REM Corporation.
REM ******************************************************************************
REM ******************************************************************************


@echo off
rem @if "%1c"=="c" goto usage
@goto install

:usage
@echo.
@echo USAGE: Install [current-working-directory]
@echo The current-working-directory is the full path containing all the
@echo IMB driver installation files, including this command file.
@echo.
@echo Example:
@echo.
@echo         Install C:\IMBDRV\Test
@echo.
@goto error

:install
@set INSTALL_DIR=%1
@echo.
DeviceSetup.exe -v install IBSMUtil.inf *IntelUtilDeV
@echo.
@echo Installing IMB driver...
@echo.
devicesetup updateonly imbdrv.inf *IMBDRV >NUL 1>&2

if errorlevel 0 echo "IMBDriver upgraded successfully"  && goto exit

DeviceSetup.exe detectmsipmi

if errorlevel 0 echo "MSIPMI Driver detected. Skipping IMBDRV installation" && goto exit

devicesetup.exe -v install imbdrv.inf *IMBDRV

:done
@echo Done!
@echo.
@echo Installation Successful
@echo.
@goto exit

:error
@echo.
@echo @@@@ Installation Failed @@@@
@echo.

:exit

rem rem rem rem rem rem rem rem rem rem 
rem MSIPMI detection script. Commented for Build 6
rem rem rem rem rem rem rem rem rem rem 
rem devicesetup updateonly imbdrv.inf *IMBDRV >NUL 1>&2
rem if errorlevel 0 echo "IMBDriver upgraded successfully"  && goto exit
rem wmic /NAMESPACE:\\root\wmi class Microsoft_IPMI >ms.txt 2>&1
rem find "No Instance(s) Available." ms.txt >NUL
rem if errorlevel 1 echo "MSIPMI Driver detected. Skipping IMBDRV installation" && goto exit
rem devicesetup install imbdrv.inf *IMBDRV
rem if errorlevel 0 echo "IMBDriver Installed Successfully" && goto exit
rem echo "Installation of IMBDRV failed"
rem :exit
rem if exist %tmp%\ms.txt del ms.txt > NUL 2>&1
