echo off
REM This batch file copies the installation files from the 5
REM Apriori GT diskettes to a hard drive.  This allows Apriori
REM setup across a network without the need for additional diskettes.

if "%1" == "" goto USAGE

if exist %1\nul goto INSTALL
echo The path " %1 " does not exist.  Please create it first, or use
echo a different path.
pause
goto END

:INSTALL
mkdir %1\disk1
mkdir %1\disk2
mkdir %1\disk3
mkdir %1\disk4
mkdir %1\disk5

:DISK1
if exist apriori.1 goto START
echo Please insert install disk one.
pause
goto DISK1

:START
copy *.* %1\disk1

:DISK2
echo Please insert install disk two.
pause
if not exist apriori.2 goto DISK2

echo APRIORI.2
copy apriori.2 %1\disk2

:DISK3
echo Please insert install disk three.
pause
if not exist win32s.1 goto DISK3

echo WIN32S.1
copy win32s.1 %1\disk3

:DISK4
echo Please insert install disk four.
pause
if not exist win32s.2 goto DISK4

echo WIN32S.2
copy win32s.2 %1\disk4

:DISK5
echo Please insert install disk five.
pause
if not exist win32s.3 goto DISK5

echo WIN32S.3
copy win32s.3 %1\disk5

echo [configuration] > %1\disk1\apriori.ini
if not "%2" == "" echo ServerName=%2 >>  %1\disk1\apriori.ini
if not "%3" == "" echo ServerDirectory=%3 >> %1\disk1\apriori.ini

goto END

:USAGE
echo Usage: "install [destination] <servername> </database/path>"
echo The destination path must already exist.

:END
