@echo off

:Initialize
  @echo.
  @echo.
  @echo.
  @echo.
  @echo.
  @echo              BORLAND TCLITE INSTALLATION
  @echo    Copyright (c) 1994 by Borland International, Inc
  @echo.
  @echo.
  @echo.
  @echo.
  if "%1"=="" goto Usage1
  if not "%INSTALL%"==""  set OLD_INST=%INSTALL%
  if not "%INST_DRV%"=="" set OLD_DRV=%INST_DRV%
  set INST_DRV=%1
  set INSTALL=%INST_DRV%
  set INSTALL=%INSTALL%\TCLITE
  if not exist unzip.exe goto Usage

:Check_for_existance
  if exist %INSTALL%\*.* set INSTALL=%INST_DRV%\TCLITEXX
  if exist %INSTALL%\*.* goto Overwrite?
  md %INSTALL%

:Install_It
  @echo.
  @echo.
  @echo.
  @echo Installing into %INSTALL% please wait.....
  @echo.
  @echo.
  unzip -d tclite.zip %INSTALL% >nul
  if errorlevel 1 goto Busted
  copy readme %INSTALL% >nul
  copy readme.com %INSTALL% >nul
  if not exist %INSTALL%\readme.com goto Busted

:All_Done
  @echo.
  @echo.
  @echo.
  @echo.
  @echo.
  @echo             BORLAND TCLITE SUCCESSFULLY INSTALLED
  @echo.
  @echo Edit your AUTOEXEC.BAT now to add %INSTALL%\BIN to your PATH
  @echo.
  @echo      Refer to %INSTALL%\readme for additional information.
  @echo.
  @echo.
  @echo.
  @echo.
  goto End



:Busted
  @echo.
  @echo.
  @echo.
  @echo  An error occured during the installation.  Check
  @echo  that there is at least 2Mbtes of free space on %INST_DRV% to
  @echo  install this product and try again.
  @echo.
  @echo.
  goto End
  
:Overwrite?
  @echo.
  @echo.
  @echo.
  @echo  %INSTALL% already exists.
  @echo.
  @echo.
  @echo  If you DO NOT want to install into %INSTALL% press
  @echo  <Crtl>Break NOW or any other key to continue the installation
  @echo.
  @echo.
  pause
  goto Install_It

:Usage1
  @echo.
  @echo.
  @echo.
  @echo.
  @echo  Usage: install drive_letter
  @echo.
  @echo         drive_letter = target drive letter including colon
  @echo                        (ie C:)
  @echo.
  @echo         You must be on the drive that contains the installation
  @echo         disk to perform this installation (ie A:).
  @echo.
  @echo.
  @echo.
  goto End
  
:Usage
  @echo.
  @echo.
  @echo.
  @echo.
  @echo  You must change to the drive that contains the installation disk
  @echo  do perform this installation. For example, if the installation
  @echo  disk is in your A drive, change to it and then type install.
  @echo.
  @echo.
  @echo.
  goto End

:End
  If "%OLD_INST%"=="" set INSTALL=
  If not "%OLD_INST%"=="" set INSTALL=%OLD_INST%
  If "%OLD_DRV%"=="" set INST_DRV=
  If not "%OLD_DRV%"=="" set INST_DRV=%OLD_INST%
