@echo off

set currentpath=%cd%
cd %~dp0
echo Installing All MRD7 Drivers for P1 hardware

cd..
echo %cd%
cd Installer\PlatformInstaller\Drivers

echo ****************
echo Install IO driver
set foldername=I2C
set infname=iaioi2ce.inf
cd %foldername% 
pnputil -i -a %infname%
cd ..

echo **************
echo Install GPIO driver
set foldername=GPIO
set infname=iaiogpioe.inf
cd %foldername% 
pnputil -i -a %infname%
cd ..

echo **************
echo Install UART driver
set foldername=UART
set infname=iaiouart.inf
cd %foldername% 
pnputil -i -a %infname%
cd ..

echo **************
echo Install GPIO Virtual driver
set foldername=GPIOVirtual
set infname=iaiogpiovirtual.inf
cd %foldername% 
pnputil -i -a %infname%
cd ..


echo **************
echo Install MBI driver
set foldername=MBI
set infname=MBI.inf
cd %foldername% 
pnputil -i -a %infname%
cd ..

echo **************
echo Install PMIC driver
set foldername=PMIC
set infname=pmic.inf
cd %foldername% 
pnputil -i -a %infname%
cd ..

echo **************
echo Install DPTF driver
set foldername=DPTF
set infname=Dptf.inf
cd %foldername% 
pnputil -i -a %infname%
cd ..

echo **************
echo Install TXEI driver
set foldername=TXEI
set infname=TXEI.inf
cd %foldername% 
pnputil -i -a %infname%
cd ..

echo **************
echo Install Camera driver
set foldername=camera
set infname=camera.inf
cd %foldername% 
pnputil -i -a camera.inf
cd ..

echo **************
echo Install Touch driver
set foldername=touch
set infname=GoodixTouchDriver.inf
cd %foldername% 
copy TouchSetting.gt c:\windows\inf && devcon.exe rescan && devcon.exe update "GoodixTouchDriver.inf" "ACPI\GDIX1001" && devcon.exe rescan
cd ..

echo **************
echo Install Audio driver
set foldername=audio
set infname=isstrtc.inf
cd %foldername% 
pnputil -i -a isstrtc.inf
pnputil -i -a rtii2sac.inf
cd ..

echo **************
echo Install Bluetooth driver
set foldername=BT
set infname=rtkuart.inf
cd %foldername% 
rem pnputil -i -a %infname%
install.exe
cd ..


echo **************
echo Install WiFi driver
set foldername=WIFI
set infname=netrtwlans.inf
cd %foldername% 
pnputil -i -a %infname%
cd ..

echo **************
echo Install graphic driver .... 
echo 
set foldername=Graphics
set infname=igdlh.inf
cd %foldername% 
pnputil -i -a %infname%
cd ..




echo All drivers for MRD7 are installed !

cd %currentpath%