REM ========================================================
REM   Driver deliverable installation
REM 
REM   Template Version: V1.03
REM	  Build Date: 2019.12.25
REM ========================================================

REM %Description of deliverable%
@ECHO OFF

:check_Permissions
ECHO Administrative permissions required. Detecting permissions...

net session >nul 2>&1
if %errorLevel% == 0 (
	ECHO Success: Administrative permissions confirmed.
) else (
	ECHO Failure: Current permissions inadequate.
	ECHO Failure: Please Run as administrator
	goto:SHOWMESSAGE
)

cd /d "%~dp0"

if /i not "%~1" == "" if exist %~1 SET "FCC_LOG_FOLDER=%~1"
if defined FCC_LOG_FOLDER (SET "APP_LOG=%FCC_LOG_FOLDER%\%~n0.log") else (SET "APP_LOG=%~n0.log")

ECHO ############################################################# >> %APP_LOG%
ECHO  [%DATE%]                                                     >> %APP_LOG%
ECHO  [%TIME%] Beginning of the %~nx0                              >> %APP_LOG%
ECHO ############################################################# >> %APP_LOG%

REM ------------------- Script Entry ------------------------
:INSTALL
echo [%TIME%] DISM.exe /Online /Add-ProvisionedAppxPackage >> %APP_LOG%
DISM.exe /Online /Add-ProvisionedAppxPackage /PackagePath:24c4e18272f54cb28ab2ff6f301bff2c.appxbundle /DependencyPackagePath:Microsoft.VCLibs.140.00_14.0.27323.0_arm__8wekyb3d8bbwe.appx /DependencyPackagePath:Microsoft.VCLibs.140.00_14.0.27323.0_arm64__8wekyb3d8bbwe.appx /DependencyPackagePath:Microsoft.VCLibs.140.00_14.0.27323.0_x64__8wekyb3d8bbwe.appx /DependencyPackagePath:Microsoft.VCLibs.140.00_14.0.27323.0_x86__8wekyb3d8bbwe.appx /LicensePath:24c4e18272f54cb28ab2ff6f301bff2c_License1.xml /Region="All"
if errorlevel 1 echo [%TIME%] DISM command failed. >> %APP_LOG% & goto RESULTFAILED
echo [%TIME%] DISM command success. >> %APP_LOG%

GOTO END

:RESULTFAILED
ECHO ERRRORLEVEL=%ERRORLEVEL% >> %APP_LOG%
ECHO ERRRORLEVEL=%ERRORLEVEL% >> .\..\..\FAILURE.FLG
GOTO END

:END
EXIT /B %errorlevel%

:SHOWMESSAGE
pause
