pushd %~dp0

:chkhwid-AX200
DeviceCheck.exe /All /HWID /D /S:"USB\VID_8087&PID_0029&REV_0001"
if %errorlevel% == 0 goto :ins-AX200
if not %errorlevel% == 0 goto :MTK_7921

:ins-AX200
pnputil -i -a "%~dp0CCP\ibtusb.inf"
goto :end

:MTK_7921
DeviceCheck.exe /All /HWID /D /S:"USB\VID_13D3&PID_3564"
if %errorlevel% == 0 goto :ins-7921
if not %errorlevel% == 0 goto :RTL8852BE

:ins-7921
pnputil -i -a "%~dp0MTK\mtkbtfilter.inf"
goto :end

:RTL8852BE
DeviceCheck.exe /All /HWID /D /S:"USB\VID_0CB8&PID_C559"
if %errorlevel% == 0 goto :ins-RTL8852BE
if not %errorlevel% == 0 goto :install_fail

:ins-RTL8852BE
pnputil -i -a "%~dp0RTL8852BE\Rtkfilter.inf"
goto :end

:install_fail
SET  Driver_LOG=C:\Windows\Logs\Bluetooth.log
IF NOT EXIST C:\Windows\Logs\ MD C:\Windows\Logs\
ECHO [%TIME%] == The Installation of BT is fail >> %Driver_LOG%
goto :end

:end
echo done
exit

