@echo off
cls
if exist install.bat goto start
echo The installation files must be on the current drive.
echo.
echo Example:
echo.
echo If you are installing from the A: drive, type "A:", [ENTER], "INSTALL".
goto end
:start
echo Synchronet Installation
echo =======================
echo.
if not '%1'=='' goto 1
echo Installing to: 
echo.
cd
echo.
echo If the above path is not the desired destination of Synchronet, hit Ctrl-C
echo now to terminate installation and run INSTALL with the desired destination
echo path as a parameter.
echo.
echo    Example: INSTALL C:\SBBS
echo.
echo If you have not already created the destination directory, you must do so
echo before running INSTALL.
echo.
echo    Example: MD C:\SBBS
echo.
echo Hit any key to continue installation or Ctrl-C to terminate.
pause > nul
:1
if exist exec.zip goto 2
pkunzip sbbs -d %1
if errorlevel 1 goto err
echo.
echo Place next disk in drive. Hit ENTER to continue or Ctrl-C to abort.
pause > nul
goto 1
:2
pkunzip exec -d %1
if errorlevel 1 goto err
:3
if exist ctrl.zip goto 4
echo.
echo Place next disk in drive. Hit ENTER to continue or Ctrl-C to abort.
pause > nul
goto 3
:4
pkunzip ctrl -d %1
if errorlevel 1 goto err
pkunzip text -d %1
if errorlevel 1 goto err
pkunzip docs -d %1
if errorlevel 1 goto err
if exist xtrn.zip pkunzip xtrn -d %1
if errorlevel 1 goto err
pkunzip node -d %1
if errorlevel 1 goto err
echo.
echo Installed.
echo.
if '%1'=='' goto curdir
attrib %1\exec\*.exe +r
cls
echo You must now change the current drive and directory to %1 and then type:
echo CD NODE1
echo SHARE
echo SBBS
goto end
:curdir
attrib exec\*.exe +r
cd node1
echo Configuring...
..\exec\scfg ..\ctrl
echo You MUST run SHARE.EXE (if not on NetWare Network). SHARE is a program 
echo that is distributed with MS-DOS and PC-DOS v3.0 and higher and must be 
echo executed prior to running SBBS.
echo.
echo After you have loaded SHARE, type SBBS from THIS directory.
goto end
:err
echo.
echo Installation error.
:end
echo.
