@ECHO OFF
REM.-- Prepare the Command Processor
SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSION
cd /d "%~dp0"

::Detect Administrator Privileges  
::echo Administrative permissions are required To Install the Kiosk Softwares
::echo Detecting Administrative Permissions
net session >nul 2>&1
if %ERRORLEVEL%==0 (
echo              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
) else (
echo Insufficient Administrator Previledges - Please login in as Administrator or Run as Administrator
echo           Exiting the setup
pause
exit
)
echo Developed by ****@Bhaskar Jyoti Kalita for Arth Rural Connect Services Ltd.****
echo              **************************************************************
echo              ***********   Welcome to The Installation of   ***************
echo		            SBI Kiosk with Morpho RD Service 2.0.1.42 (20-02-2021)
echo              **************************************************************
echo			 ~~~REMOVE MORPHO FINGER PRINT SCANNER FROM COMPUTER~~~
pause
RunDll32.exe InetCpl.cpl,ResetIEtoDefaults
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351
echo			Installing Java
start /wait /d  "%CD%\Java" Java.exe
if "%PROCESSOR_ARCHITECTURE%"=="x86" (
XCOPY /Q "%CD%\Policy\*.*" "%systemdrive%\Program Files\Java\jre7\lib\security\" /I /s /Y
XCOPY /Q "%CD%\Jar\*.*" "%systemdrive%\Program Files\Java\jre7\lib\ext\" /I /s /Y
) else (
XCOPY /Q "%CD%\Policy\*.*" "%systemdrive%\Program Files (x86)\Java\jre7\lib\security\" /I /s /Y
XCOPY /Q "%CD%\Jar\*.*" "%systemdrive%\Program Files (x86)\Java\jre7\lib\ext\" /I /s /Y
)
if "%PROCESSOR_ARCHITECTURE%"=="x86" (
XCOPY /Q "%CD%\RegistryFiles\*.*" "%systemdrive%\Windows\System32\" /I /s /Y
regedit /s "%systemdrive%\Windows\System32\Java_Registry_Settings_X86.reg"
regedit /s "%systemdrive%\Windows\System32\SBI_IE_Settings.reg"
) else (
XCOPY /Q "%CD%\RegistryFiles\*.*" "%systemdrive%\Windows\System32\" /I /s /Y
regedit /s "%systemdrive%\Windows\System32\Java_Registry_Settings_X64.reg"
regedit /s "%systemdrive%\Windows\System32\SBI_IE_Settings.reg"
)
if "%PROCESSOR_ARCHITECTURE%"=="x86" (
XCOPY /Q "%CD%\Shortcut\X86\*.*" "%USERPROFILE%\Desktop\" /I /s /Y
) else (
XCOPY /Q "%CD%\Shortcut\X64\*.*" "%USERPROFILE%\Desktop\" /I /s /Y
)
XCOPY /Q "%CD%\FavoriteURL\Arth-SBI Financial Inclusion.url" "%USERPROFILE%\Favorites\" /I /s /Y
XCOPY /Q "%CD%\FavoriteURL\Arth-SBI Financial Inclusion.url" "%USERPROFILE%\Favorites\Links" /I /s /Y  
XCOPY /Q "%CD%\cert"  "%systemdrive%\cert" /I /s /Y
start /wait /d "%CD%\cert" certificate.cer
echo			AEPS Settings are Completed
echo			Installing Morpho API MSO 
start /wait /d "%CD%\Softwares" setup.exe
echo			Installing Morpho RD Service
start /wait /d "%CD%\RDService" MorphoRdServiceL0SoftSetup.exe
XCOPY /Q "%CD%\Root"  "%systemdrive%\root" /I /s /Y
::XCOPY /Q "%CD%\Server"  "%systemdrive%\MorphoRdServiceL0Soft" /I /s /Y
echo 127.0.0.1		rd.kiosk.com >> "%systemdrive%\Windows\System32\drivers\etc\hosts"
start /wait /d "%systemdrive%\root" root.cer
echo			*SBI Kiosk Installation with Morpho RD Service is Completed Successfully*
echo			  Restart Computer and Connect Morpho Finger Print Scanner Developed by @Bhaskar Jyoti Kalita 
pause
exit
