@ECHO OFF
echo.
echo Installing Thunderbolt HSA for Windows. Please wait...
echo.

:: SET Variables
set CURDIR=%CD%
set APPXNAME=%CURDIR%\0ea8c010cef740f0910f5f4a18e439c9.appx
set LICENSE=%CURDIR%\0ea8c010cef740f0910f5f4a18e439c9_License1.xml
set DPNDNCY1=%CURDIR%\Microsoft.NET.Native.Framework.2.1_2.1.27427.0_x64__8wekyb3d8bbwe.appx
set DPNDNCY2=%CURDIR%\Microsoft.NET.Native.Runtime.2.1_2.1.26424.0_x64__8wekyb3d8bbwe.appx
set DPNDNCY3=%CURDIR%\Microsoft.VCLibs.140.00_14.0.30035.0_x64__8wekyb3d8bbwe.appx

:: Install HSA
DISM /Online /Add-ProvisionedAppxPackage /PackagePath:"%APPXNAME%" /LicensePath:"%LICENSE%" /DependencyPackagePath:"%DPNDNCY1%" /DependencyPackagePath:"%DPNDNCY2%" /DependencyPackagePath:"%DPNDNCY3%" /Region="All"
IF ERRORLEVEL 1 GOTO ERROR

:EXIT
ECHO Thunderbolt HSA installation finished successfully.
exit /b 0

:ERROR
ECHO Thunderbolt HSA installation failed. Error code: %ERRORLEVEL%
exit /b 1