@echo off
REM INSTALL VARIABLES
set temppath=C:\temp\bb
set tempparent=C:\TEMP
set instpath=D:\rs-pkgs



echo  ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo  Ί           "Bouce-Backup" Disk to Disk NT Backup Service          Ί
echo  Ί                            V 2.0-NT                              Ί
echo  ΜΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΉ
echo  Ί                      PROPERTY OF RACKSPACE                       Ί
echo  Ί                   Thomas Weeks, 2001-07-23  (C)                  Ί
echo  ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
REM **** IF UPGRADING BB, CHANGE THE VERSION LOGGER AFTER "DONE" SECTION
echo.
echo                        Hit Any Key To Continue...
pause >NUL:
cls

REM *** Chceck If Already Installed...
if exist %instpath%\bounce-backup\BB-NOW.COM goto ALREADY

REM *** Check If Decompressed To Correct Location... C:\TEMP\BB
if exist %temppath%\instalbb.bat goto OKGO
goto NOGO


:OKGO
echo.
echo  ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo  Ί                  !!! READ BEFORE CONTINUING !!!                  Ί
echo  ΜΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΉ
echo  Ί     Q: Do you have a D: drive partition where BB will install to?Ί
echo  Ί                                                                  Ί
echo  Ί     Q: Have you installed a second Hard Drive for Bounce-Backup  Ί
echo  Ί        to clone to yet?                                          Ί
echo  Ί            -To install Bounce-Backup, the server needs a second  Ί
echo  Ί             "Data Drive" to clone the first drive to. The drive  Ί
echo  Ί              must be an IDE if using IDE, SCSI if using SCSI.    Ί
echo  Ί                                                                  Ί
echo  Ί     Q: Is the "Schedule" service running?                        Ί
echo  Ί            -This is how Bounce-Backup runs it's "BB-NOW" script. Ί
echo  Ί                                                                  Ί
echo  Ί                      --DO NOT CONTINUE--                         Ί
echo  Ί           IF YOU HAVE NOT MET THE ABOVE REQUIREMENTS!            Ί
echo  Ί                                                                  Ί
echo  ΜΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΉ
echo  Ί For HELP, Open "Bounce-Backup_Customer_Readme.doc from MS-Word   Ί
echo  ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
echo.
echo Hit CTRL-C To Abort
echo         OR
echo Hit Any Key To Continue...
pause >NUL:

cls
echo  ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo  Ί                   Checking For System Scheduler                  Ί
echo  ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
sleep 1
REM check that the task scheduler is running
call at > NUL:
if errorlevel 1 goto atNotOK
if not errorlevel 1 if errorlevel 0 goto atOK

:atNotOK
echo ***************************
echo *                         *
echo *        ERROR !!!        *
echo *                         *
echo ***************************
echo.
echo ! Task Scheduler Service is not running.
sleep 1
echo ! You need to be running "Schedule" and have it set to Automatic.
sleep 1
echo.
sleep 2
echo -Turn on "Scheduler" in services
sleep 1
echo -Try running the install again
pause
goto End

:atOK
echo.
echo 				-Scheduler is OK...
sleep 3



REM ************************ File-Copy Section ************************
cls
echo  ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo  Ί     Setting Up Needed Directories: D:\RS-pkgs\ and D:\temp       Ί
echo  ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
md %instpath% >NUL:
md D:\temp >NUL:
echo.
echo 				-Done Setting Up Dirs
sleep 3


echo.
echo.
echo.

cls
echo  ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo  Ί                    Copying Bounce-Backup Files                   Ί
echo  ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
echo -Copying all files over from %temppath% to %instpath%
echo -binaries...
xcopy /e /s %temppath%\*.* %instpath% >NUL:
echo -desktop ERD link...
xcopy %temppath%\Bounce-Backup\BB_Update_ERD.pif C:\WINNT\PROFILES\ADMINISTRATOR\DESKTOP >NUL:
echo -user documentation...
xcopy %temppath%\Bounce-Backup_C*.doc C:\WINNT\PROFILES\ADMINISTRATOR\DESKTOP >NUL:
echo -checking/nuking old ERD link
if exist C:\WINNT\PROFILES\ADMINISTRATOR\DESKTOP\Update_ERD.lnk del C:\WINNT\PROFILES\ADMINISTRATOR\DESKTOP\Update_ERD.lnk >NUL:
echo -desktop Bounce-Backup link...
xcopy %temppath%\Bounce-Backup\Bounce-Backup.pif C:\WINNT\PROFILES\ADMINISTRATOR\DESKTOP >NUL:
echo -"bad drive" Warning BMP file
xcopy %temppath%\Bounce-Backup\BB-warning.bmp %windir%  >NUL:
echo -customer documentation to the administrator desktop
xcopy %temppath%\Bounce-Backup_Customer_Readme.doc C:\WINNT\PROFILES\ADMINISTRATOR\DESKTOP >NUL:

echo.
echo 				-Done Copying Files
sleep 3


echo.
echo.
echo.

echo.
echo -Clean up, stage 1...
del %instpath%\instal*.*
sleep 1

echo.
echo -Setting up new system paths...
echo.
%instpath%\bin\pathman /as %instpath%\bin;%instpath%\bounce-backup
sleep 1


REM ******************* Admin Password For AutoLogin ********************
::Not Being Used Yet.....


REM ************************ Drive Size UI **************************
REM This determines how long the monitoring scripts will stop wathcing
REM this server for.
cls
echo.
echo  ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo  Ί                          Hard Drive Setup                        Ί
echo  ΜΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΉ
echo  Ί                                                                  Ί
echo  Ί Q: Roughly how large is the hard drive in this system?(round up) Ί
echo  Ί                                                                  Ί
echo  Ί       1) 10 GB                                                   Ί
echo  Ί       2) 20 GB                                                   Ί
echo  Ί       3) 36 GB                                                   Ί
echo  Ί       4) 60 GB                                                   Ί
echo  Ί       5) 80 GB                                                   Ί
echo  Ί       6) 180 GB                                                  Ί
echo  Ί                                                                  Ί
echo  ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
echo.
wait 1
choice /c:123456
if errorlevel 6 set ttime=270
if not errorlevel 6 if errorlevel 5 set ttime=120
if not errorlevel 5 if errorlevel 4 set ttime=90
if not errorlevel 4 if errorlevel 3 set ttime=54
if not errorlevel 3 if errorlevel 2 set ttime=30
if not errorlevel 2 if errorlevel 1 set ttime=15

REM These are the the AVG-MAX times (in min.) that the system will be down for the 
REM given hard drive sizes.  (times are calculated by DriveGB * 0.75 * (500MB/min)


REM ** This variable bbtime is important, as it determines how
REM ** many minutes that the monitoring system will assume that
REM ** this server will be down for for backup!!!
echo.
echo - Setting Bounce-Backup downtime system variable "bbtime" based on drive size.
setx bbtime %ttime% -m

echo.
echo 				-Drive size and BBTIME is set...
sleep 3


REM *********************** NT-BOOT Disk Creation ***********************
REM This creates the initial NT-BOOT disk in case the server is rebooted.
cls

echo.
echo  ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo  Ί                         Floppy Disk Setup                        Ί
echo  ΜΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΉ
echo  Ί                                                                  Ί
echo  Ί  1) Please Label NEW, High Quality Blank 1.44M Floppy and Insert Ί
echo  Ί                                                                  Ί
echo  Ί  2) Verify that the WRITE PROTECT TAB is closed, and insert disk Ί
echo  Ί                                                                  Ί
echo  Ί  3) MAKE SURE THAT BIOS is set to boot off A: ONLY (when done)   Ί
echo  Ί                                                                  Ί
echo  ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
echo.
echo -Hit Any Key To Continue...
dir %instpath%\Bounce-Backup\NT-BOOT.COM >nul:
pause >NUL:
call %instpath%\Bounce-Backup\NT-BOOT

echo.
echo 				-Floppy Created...
sleep 3

cls
echo  ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo  Ί       !!! Don't Forget To Set Up The BIOS To Boot Off A: !!!     Ί
echo  ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
echo.
pause
echo.
echo.
echo                            ! Really !
pause
echo.
echo.
echo                            ! I mean it !
pause



REM ******************* Set Admin-Only Read ACLs *******************
cls
echo  ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo  Ί    Setting Up Read-Only ACLS on D:\RS-pkgs\Bounce-Backup         Ί
echo  ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
echo.
echo -Setting ACLs
sleep 2
xcacls %instpath%\bounce-backup\* /T /G administrator:RX;TRX /Y >NUL:
xcacls %instpath%\bounce-backup\* /E /T /G rack:RX;TRX /Y >NUL:
xcacls %instpath%\bounce-backup\* /E /T /G SYSTEM:RX;TRX /Y >NUL:
xcacls %instpath%\bounce-backup /T /G administrator:RX;TRX /Y >NUL:
xcacls %instpath%\bounce-backup /E /T /G rack:RX;TRX /Y >NUL:
xcacls %instpath%\bounce-backup /E /T /G SYSTEM:RX;TRX /Y >NUL:
echo.
echo 				-Done with ACLs
echo.
sleep 2


REM ******************** Scheduler Section ************************
cls
echo  ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo  Ί           Setting Up Scheduler for BB-NOW and Drivechk           Ί
echo  ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
echo.
sleep 1
echo -Setting BB-NOW
echo.
at 01:37 /interactive  /every:Su %instpath%\Bounce-Backup\BB-NOW.COM
echo.
sleep 1

REM ******************* Drive Checker *****************************
echo -Setting Drivechk
echo.
at  06:37 /every:Su,M,T,W,Th,F,S %instpath%\Bounce-Backup\drivechk.com
echo.
sleep 1
echo.
echo 				-Done with Scheduler...
echo.
sleep 2


cls
echo -Cleaning up, stage 2
echo.
del %temppath%\..\bb.zip >nul:
echo -Done Cleaning...
sleep 1
goto END


:ALREADY
cls
echo             !!!!! It looks like this package is already installed !!!!!
echo                                   --ABORTING--
sleep 2
echo To Reinstall:
echo ΝΝΝΝΝΝΝΝΝΝΝΝΝ
sleep 1
echo -Right Click, Properties of D:\RS-pkgs\Bounce-Backup
sleep 1
echo -Change Security Tab, Permissions to FULL-ALL-ALL
sleep 1
echo -Check the "Replace Permissions on Subderectories" box
sleep 1
echo -Click OK, YES, OK
sleep 1
echo -Delete the D:\RS-pkgs\Bounce-Backup and all contents
sleep 1
echo -Re-Run Install Script
sleep 1
pause
goto ENDEND

:NOGO
echo !!!!! This Package Needs to Be Decompressed To %TEMPPARENT% !!!!!
echo.
echo.
echo -Please Clean Up your current directory
sleep 1
echo -Place the ZIP file in %TEMPPARENT%
sleep 1
echo -"Extract it" to %tempparent% (it will create %tempparent%\bb)
sleep 1
echo -Then "cd %temppath%" 
sleep 1
echo -Try install again... (rerun instalbb.bat)
echo.
sleep 1
echo                       --ABORTING--
pause
goto ENDEND



:END
cls
echo.
sleep 1
echo  ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
sleep 1
echo  Ί                             D O N E                              Ί
sleep 1
echo  ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
sleep 1
echo.

now >> D:\rs-pkgs\BB-LOG.TXT
echo INSTALL:Installed BB_V2-2001-07-23 >> D:\rs-pkgs\BB-LOG.TXT
echo. >> D:\rs-pkgs\BB-LOG.TXT

if exist %instpath%\rm.bat call %instpath%\rm.bat >NUL:
pause
echo.


:ENDEND
echo.
