@echo OFF

if not exist \\P26239\PUB\FASTLOAD_EXE goto notavailable

echo Unregistering obsolete versions of fastload client programs...
if exist %INSTROOT%\pgm\SAPDBxABRegLib.dll    regsvr32 /u /s %INSTROOT%\pgm\SAPDBxABRegLib.dll
if exist %INSTROOT%\pgm\SAPFastLoadWizard.dll regsvr32 /u /s %INSTROOT%\pgm\SAPFastLoadWizard.dll
if exist %INSTROOT%\pgm\SAPLoadOdbc.dll       regsvr32 /u /s %INSTROOT%\pgm\SAPLoadOdbc.dll
if exist %INSTROOT%\pgm\SAPLSServerDll.dll    regsvr32 /u /s %INSTROOT%\pgm\SAPLSServerDll.dll
if exist %INSTROOT%\pgm\SAPLSSvrExe.exe       %INSTROOT%\pgm\SAPLSSvrExe.exe	/unregserver


echo Copying new version of files to %INSTROOT%\pgm ...
xcopy /D \\P26239\PUB\FASTLOAD_EXE\Fastload.exe          %INSTROOT%\pgm\
xcopy /D \\P26239\PUB\FASTLOAD_EXE\SAPDBxABRegLib.dll    %INSTROOT%\pgm\
xcopy /D \\P26239\PUB\FASTLOAD_EXE\SAPFastLoadWizard.dll %INSTROOT%\pgm\
xcopy /D \\P26239\PUB\FASTLOAD_EXE\SAPLoadOdbc.dll       %INSTROOT%\pgm\
xcopy /D \\P26239\PUB\FASTLOAD_EXE\SAPLSServerDll.dll    %INSTROOT%\pgm\
xcopy /D \\P26239\PUB\FASTLOAD_EXE\SAPLSSvrExe.exe       %INSTROOT%\pgm\

echo Register new fastload client exe's and dll's...
if exist %INSTROOT%\pgm\SAPDBxABRegLib.dll     regsvr32 /s %INSTROOT%\pgm\SAPDBxABRegLib.dll
if exist %INSTROOT%\pgm\SAPFastLoadWizard.dll  regsvr32 /s %INSTROOT%\pgm\SAPFastLoadWizard.dll
if exist %INSTROOT%\pgm\SAPLoadOdbc.dll        regsvr32 /s %INSTROOT%\pgm\SAPLoadOdbc.dll
if exist %INSTROOT%\pgm\SAPLSServerDll.dll     regsvr32 /s %INSTROOT%\pgm\SAPLSServerDll.dll
if exist %INSTROOT%\pgm\SAPLSSvrExe.exe        %INSTROOT%\pgm\SAPLSSvrExe.exe	/regserver


echo Creating shortcut for fastload client...

if exist %INSTROOT%\pgm\Fastload.exe shortcut -f -t %INSTROOT%\pgm\Fastload.exe -i  %INSTROOT%\pgm\Fastload.exe -n "%USERPROFILE%\\Desktop\\Fastload Client.lnk"

echo ############################################
echo #  Fastload client successfully installed  #
echo ############################################

goto installend

:notavailable

echo ######################################################################
echo #  Fastload client not available. Please (!) report to Steffen :-((  #
echo ######################################################################


:installend
