@ECHO OFF
ECHO. 
ECHO *** Installing Wacom Wintab driver ***

SET INSTALLPATH=%~dp0
call uninstall.bat

pnputil.exe /add-driver "%INSTALLPATH%\Driver\WacHIDRouterISDF.inf" /subdirs /install
pnputil.exe /add-driver "%INSTALLPATH%\Driver\WacHIDRouterISDU.inf" /subdirs /install
pnputil.exe /add-driver "%INSTALLPATH%\Driver\WTabletServiceISD.inf" /subdirs /install
pnputil.exe /add-driver "%INSTALLPATH%\Driver\WacRouterFilterISD.inf" /subdirs /install

SET EXITCODE=%errorlevel%

IF %EXITCODE% EQU 0 GOTO EXIT0
IF %EXITCODE% EQU 259 GOTO EXIT259
IF %EXITCODE% EQU 1641 GOTO EXIT1641
IF %EXITCODE% EQU 3010 GOTO EXIT3010

:EXIT0
ECHO *** The driver installed successfully! *** 
GOTO END

:EXIT259
ECHO *** Best driver version for your device is already installed! *** 
GOTO END

:EXIT1641
ECHO *** Installation is complete and reboot will start soon! *** 
GOTO END

:EXIT3010
ECHO *** Installation is complete but reboot is required! *** 
GOTO END

:END

