:: =====================================
::      RTKAudio Script V1.0
:: =====================================

pushd %~dp0
:: ==== [0]check hwid,add here ====
:: %drvroot%DeviceCheck.exe /All /HWID /D /S:hwid1,hwid2
:: if /i not %errorlevel%==0 goto :end
:: ==== [1]If no need output, just remove below line ====
set outlog=%drvroot%RTKAudio.log

@echo install RTK Audio Console...

dism /online /add-provisionedappxpackage /packagepath:"RtkUWP_223\a1f3294c5814403dacf6146b3e93943b.appxbundle" /dependencypackagepath:"RtkUWP_223\Microsoft.VCLibs.140.00_14.0.27810.0_x64__8wekyb3d8bbwe.appx" /dependencypackagepath:"RtkUWP_223\Microsoft.VCLibs.140.00_14.0.27810.0_x86__8wekyb3d8bbwe.appx" /Licensepath:"RtkUWP_223\a1f3294c5814403dacf6146b3e93943b_License1.xml" /REGION=ALL

TimeOut /T 10 /Nobreak >nul

@echo *** dism online install DTS Audio Processing HSA msix files ***
cd %~dp0DTSHSAApp
dism.exe /online /Add-ProvisionedAppxPackage /PackagePath:"f7391206d7a54bf8887c73d9dbd51792.appx" /LicensePath:"f7391206d7a54bf8887c73d9dbd51792_License1.xml" /DependencyPackagePath:"Microsoft.NET.Native.Framework.1.7_1.7.27413.0_x64__8wekyb3d8bbwe.appx" /DependencyPackagePath:"Microsoft.NET.Native.Runtime.1.7_1.7.27422.0_x64__8wekyb3d8bbwe.appx" /DependencyPackagePath:"Microsoft.VCLibs.140.00_14.0.27810.0_x64__8wekyb3d8bbwe.appx" /REGION=ALL
cd ..

goto :Other

:NG
:: ==== [4]Record ins fail message here ====
echo "RTK Audio Install Fail" >> %drvinslog%
popd
exit /b1

:Other
:: ==== [5]Delay,Reboot,Check Driver Version, add here
TimeOut /T 5 /Nobreak >nul
>>%drvroot%hwidver.txt set /p="VEN_10EC&DEV_0256:6.0.8981.1"<nul
>>%drvroot%hwidver.txt echo.
>>%drvroot%hwidver.txt set /p="VEN_DTSI&AID_DTSI2:1.3.4.1"<nul
goto :end

:end
popd