@echo off

if "%1" == "" goto default

xcopy "%~dp0""*" %1 /E /C /H /I /Y
regsvr32 /s %1"\\THCashDrawerCO.ocx"
regsvr32 /s %1"\\THCashDrawerSO.dll"
regsvr32 /s %1"\\THPOSPrinterCO.ocx"
regsvr32 /s %1"\\THPOSPrinterSO.dll"

goto setreg

:default
xcopy "%~dp0""*" "C:\OPOS\TH180\" /E /C /H /I /Y
regsvr32 /s "C:\OPOS\TH180\THCashDrawerCO.ocx"
regsvr32 /s "C:\OPOS\TH180\THCashDrawerSO.dll"
regsvr32 /s "C:\OPOS\TH180\THPOSPrinterCO.ocx"
regsvr32 /s "C:\OPOS\TH180\THPOSPrinterSO.dll"

:setreg
xcopy "%~dp0""THSharedPort.exe" "C:\Winnt\system32\" /C /H /I /Y
xcopy "%~dp0""SxJcp32.dll" "C:\Winnt\system32\" /C /H /I /Y


"%~dp0""TH_registry.reg"

:end
