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

:: SET Variables
set CURDIR=%CD%
set APPXNAME=%CURDIR%\333d726a56e3414095dd41bb69a47395.appx
set LICENSE=%CURDIR%\333d726a56e3414095dd41bb69a47395_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.29231.0_x64__8wekyb3d8bbwe.appx
set DPNDNCY4=%CURDIR%\Microsoft.NET.Native.Framework.2.1_2.1.27427.0_x86__8wekyb3d8bbwe.appx
set DPNDNCY5=%CURDIR%\Microsoft.NET.Native.Runtime.2.1_2.1.26424.0_x86__8wekyb3d8bbwe.appx
set DPNDNCY6=%CURDIR%\Microsoft.VCLibs.140.00_14.0.29231.0_x86__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