@echo off
echo.
echo ******************************************************************************
echo *******Intel Management Engine 16.0 Sofware Driver Installation [START]*******
echo ******************************************************************************
echo.

rem =============================Check for vPro=============================
"%~dp0TpDevPE.exe" /CM "PCI\VEN_8086&DEV_51E3"
if errorlevel 1 GOTO NonvPro_Install
rem =============================Check for vPro=============================

:Vpro_Install
rem =======================MESW drivers and Components(vPro)======================
echo.
echo.
echo System is vPro...
echo Installing MEI(HECI) and SOL drivers...
echo.

pnputil /add-driver "%~dp0MEI_SOL_Drivers\MEI\win10\heci.inf" /install
pnputil /add-driver "%~dp0MEI_SOL_Drivers\SOL\mesrl.inf" /install

echo.
echo.
echo Installing ME Software Components(WMIProvider, JHI, LMS, WiMAN and Extension INFs)...
echo.

pnputil /add-driver "%~dp0MESW_Components\WMIProvider\MEWMIProv.inf" /install
pnputil /add-driver "%~dp0MESW_Components\JHI\win10\DAL.inf" /install
pnputil /add-driver "%~dp0MESW_Components\LMS\LMS.inf" /install
pnputil /add-driver "%~dp0MESW_Components\SOL_LMS_Extension\SOLLMSExtension.inf" /install

pnputil /add-driver "%~dp0MESW_Components\wiman_wlan_extension\wiman_wlan_extension.inf" /install
pnputil /add-driver "%~dp0MESW_Components\WiMan\WiMan.inf" /install

GOTO END

:NonvPro_Install
rem =======================MESW drivers and Components(non-vPro)======================
echo.
echo.
echo System is non-vPro...
echo Installing MEI(HECI) driver...
echo.

pnputil /add-driver "%~dp0MEI_SOL_Drivers\MEI\win10\heci.inf" /install

echo.
echo.
echo Installing ME Software Components(WMIProvider, JHI, LMS and OEMExtension INF)...
echo.

pnputil /add-driver "%~dp0MESW_Components\WMIProvider\MEWMIProv.inf" /install
pnputil /add-driver "%~dp0MESW_Components\JHI\win10\DAL.inf" /install


:END

echo.
echo ******************************************************************************
echo ********Intel Management Engine 16.0 Sofware Driver Installation [END]********
echo ******************************************************************************
echo.


