SET NOTRAY=
@REM Uncomment next line to inhibit the tray from appearing
@REM SET NOTRAY=-notray

cd \progra~1\tsharc
md i386
copy \windows\system32\hid.dll .\i386
copy \windows\system32\drivers\hidclass.sys .\i386
copy \windows\system32\drivers\hidparse.sys .\i386
copy \windows\system32\drivers\hidusb.sys .\i386
copy \windows\system32\drivers\mouclass.sys .\i386
copy \windows\system32\drivers\mouhid.sys .\i386
copy tsharc.cab \windows

@if "%1"=="COM1" goto COM1
@if "%1"=="COM2" goto COM2
@if "%1"=="COM3" goto COM3
@if "%1"=="COM4" goto COM4
@if "%1"=="COM5" goto COM5
@if "%1"=="COM6" goto COM6
@if "%1"=="COM7" goto COM7
@if "%1"=="COM8" goto COM8

:USB
@echo Installing TSHARC USB driver
@REM Allow sufficient time for FBA to initialize USB devices
xpe_delay 7000
setup -silent -usb %NOTRAY%
@goto exit

:COM1
@echo Installing TSHARC Serial Driver on COM1
setup -silent -com1 %NOTRAY%
@goto exit

:COM2
@echo Installing TSHARC Serial Driver on COM2
setup -silent -com2 %NOTRAY%
@goto exit

:COM3
@echo Installing TSHARC Serial Driver on COM3
setup -silent -com3 %NOTRAY%
@goto exit

:COM4
@echo Installing TSHARC Serial Driver on COM4
setup -silent -com4 %NOTRAY%
@goto exit

:COM5
@echo Installing TSHARC Serial Driver on COM5
setup -silent -com5 %NOTRAY%
@goto exit

:COM6
@echo Installing TSHARC Serial Driver on COM6
setup -silent -com6 %NOTRAY%
@goto exit

:COM7
@echo Installing TSHARC Serial Driver on COM7
setup -silent -com7 %NOTRAY%
@goto exit

:COM8
@echo Installing TSHARC Serial Driver on COM8
setup -silent -com8 %NOTRAY%

:exit
@del \windows\tsharc.cab

