@echo off 
echo Wacom Components Driver Image Install Script 
set OLDOS=0
set RS3=0

ver | find "10.0.16" > nul  && set RS3=1
ver | find "10.0.15" > nul  && set OLDOS=1
ver | find "Version 6." > nul  && set OLDOS=1
if %OLDOS% == 1 (
	echo This driver is only supported on Win10 RS3 and above
	GOTO Exit
)

IF "%1"=="noapp" GOTO Driver 

echo Installing Wacom Settings App Package
:: Install Wacom Components Settings App 
if %RS3% == 1 (
	Dism /Online /Add-ProvisionedAppxPackage /PackagePath:"%~dp0App\f5f73e9e05bc4a95b4d32e484642a2d0.msixbundle"  /LicensePath:"%~dp0App\f5f73e9e05bc4a95b4d32e484642a2d0_License1.xml"
) ELSE (
	Dism /Online /Add-ProvisionedAppxPackage /PackagePath:"%~dp0App\f5f73e9e05bc4a95b4d32e484642a2d0.msixbundle"  /LicensePath:"%~dp0App\f5f73e9e05bc4a95b4d32e484642a2d0_License1.xml" /Region:All 
)

IF "%1"=="apponly" GOTO Exit 

IF "%1"=="yetifix" (
sc config EinkSvr start=disabled
net stop EinkSvr
 ) 


:Driver
PnpUtil.exe /scan-devices

if %PROCESSOR_ARCHITECTURE% == ARM64 (
	 echo Install Wacom Components Kernel Driver 
	PnpUtil.exe /add-driver "%~dp0ARM64\WacHIDRouterISDU.inf" /install 
	PnpUtil.exe /add-driver "%~dp0ARM64\WacHIDRouterISDF.inf" /install 

	 echo Install Wacom Components Service 
	PnpUtil.exe /add-driver "%~dp0ARM64\WTabletServiceISD.inf" /install 
) ELSE (
	echo Install Wacom Components Kernel Driver 
	PnpUtil.exe /add-driver "%~dp064\WacHIDRouterISDU.inf" /install 
	PnpUtil.exe /add-driver "%~dp064\WacHIDRouterISDF.inf" /install 

	 echo Install Wacom Components Service 
	PnpUtil.exe /add-driver "%~dp064\WTabletServiceISD.inf" /install 
)

IF "%1"=="yetifix" (
sc config EinkSvr start=auto
net start EinkSvr
) 



 :Exit
  
