:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Setting Parameters
Set Destination=%ProgramFiles%\SIX Payment Services Ltd\MPD(Multi Protocol Driver)


:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Testing Administartive permissions
@echo off
cls
ECHO.
Echo Administrative permissions required. Detecting ...

Net Session >nul 2>&1
If %errorLevel% == 0 (
   Echo Success: Administrative permissions confirmed.
   goto Install
) else (
   COLOR 0C
   ECHO.
   ECHO.
   ECHO.ERROR: Logged-on user does not have administrative privilege!
   ECHO.
   ECHO.Logon as administrator or try right click on %0 and select 'Run as administrator'
   ECHO.
   ECHO.
   ECHO.
   PAUSE
   COLOR 07 
   cls
   Exit /B 1
)


:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: starting installation
:Install
CD /D "%~dp0"
@echo on


Set /p Version= < version.cli

regsvr32 ".\%Version%\Windows\eftoa.dll" /u /s

md "%Destination%"

copy .\%Version%\Windows\eftoa.dll       "%Destination%" /Y

regsvr32 "%Destination%\eftoa.dll" /s

Set Version=

Set Destination=

pause



