@echo off
setlocal enabledelayedexpansion 
cd %~dp0

rem withoutUWP, with headset mic Senary APO and PortC Senary APO
powershell "Get-PnpDevice -FriendlyName '*audio*'|Select-Object -Property HardwareID"|findstr /i "14F1032A 05266002 278212B1 14F10230 14F10341 14F10349 14F10330 14F10343"
if !errorlevel!==0 goto Install-ATN1

rem withoutUWP, with headset mic Senary APO and Intel dmic Senary APO
powershell "Get-PnpDevice -FriendlyName '*audio*'|Select-Object -Property HardwareID"|findstr /i 14F10227
if !errorlevel!==0 goto Install-DN39B2

rem with UWP and without Senary APO
powershell "Get-PnpDevice -FriendlyName '*audio*'|Select-Object -Property HardwareID"|findstr /i "1D05120A 1D05120b 1D05120c 1D05120d 104310A3 10431313"
if !errorlevel!==0 goto Install-MRID6-ASUS

rem withUWP, with headset mic Senary APO and Intel dmic Senary APO
powershell "Get-PnpDevice -FriendlyName '*audio*'|Select-Object -Property HardwareID"|findstr /i "1EC91A01 1EC91A04 1E39B991 1E39A991"
if !errorlevel!==0 goto Install-Haier

rem only install base and oem ext infs
call Install_scripts\Install.bat
cd %~dp0
goto end

:Install-ATN1
call Install_scripts\Install-ATN1.bat
cd %~dp0
goto end
:Install-DN39B2
call Install_scripts\Install-DN39B2.bat
cd %~dp0
goto end

:Install-MRID6-ASUS
call Install_scripts\Install-MRID6-ASUS.bat
cd %~dp0
goto end

:Install-Haier
echo pnputil /add-driver "cisstrtU-base.inf" /install
pnputil /add-driver "cisstrtU-base.inf" /install
echo pnputil /add-driver "cisstrtU-ext-OEM-common.inf" /install
pnputil /add-driver "cisstrtU-ext-OEM-common.inf" /install
echo pnputil /add-driver ".\SynaAPO\cisstrtU-component-OEM.inf" /install
pnputil /add-driver ".\SynaAPO\cisstrtU-component-OEM.inf" /install
echo pnputil /add-driver ".\SynaAPO\AudioService.inf" /install
pnputil /add-driver ".\SynaAPO\AudioService.inf" /install
pnputil /add-driver SenaryAPO/"SenaryAPO.inf" /install
pnputil /add-driver SenaryAPO/"IntcDMicExt_Senary.inf" /install

cd %~dp0

:end
