@echo off
if "%3" == "start" goto skip
echo.
echo ***********************************
echo *  DATMAN INSTALLATION Ver. 1.15  *
echo ***********************************
echo.
:skip
if "%1" == "" goto help
if "%3" == "start" goto start
rem detecting where the source (diskette) is ------------------------------
if "%0" =="a:install"       a:\install.bat %1 a: start
if "%0" =="a:install.bat"   a:\install.bat %1 a: start
if "%0" =="a:\install"      a:\install.bat %1 a: start
if "%0" =="a:\install.bat"  a:\install.bat %1 a: start
if "%0" =="b:install"       b:\install.bat %1 b: start
if "%0" =="b:install.bat"   b:\install.bat %1 b: start
if "%0" =="b:\install"      b:\install.bat %1 b: start
if "%0" =="b:\install.bat"  b:\install.bat %1 b: start
if "%0" =="install"         if exist .\install.bat .\install.bat %1 . start
if "%0" =="install.bat"     if exist .\install.bat .\install.bat %1 . start
if "%0" ==".\install"       if exist .\install.bat .\install.bat %1 . start
if "%0" ==".\install.bat"   if exist .\install.bat .\install.bat %1 . start
echo Can't run INSTALL as typed.  Make the install directory current, first.
goto usage
rem ---------------------------------------------------------------------
:start
mkdir %1
set  DATMANTMP=%COPYCMD%
set  COPYCMD=/Y
echo Copying DATMAN files into %1...
copy  %2\*.me  %1 >nul
copy  %2\*.doc %1 >nul
copy  %2\*.exe %1 >nul
copy  %2\*.txt %1 >nul
copy  %2\dformat.bat %1 >nul
set  COPYCMD=%DATMANTMP%
set  DATMANTMP=
echo rem %1\loadaspi.exe %1\ASPIXXXX.SYS PARAMETERS... >%1\godatman.bat
echo @echo. >>%1\godatman.bat
echo @echo   The line above must be edited (for your ASPI manager). >>%1\godatman.bat
echo @echo   If the ASPI manager is installed via CONFIG.SYS (device=ASPIXXX), >>%1\godatman.bat
echo @echo   don't run LOADASPI (you should install an ASPI manager just once). >>%1\godatman.bat
echo @echo. >>%1\godatman.bat
echo @pause >>%1\godatman.bat
echo %1\datmanfe.exe -d3 %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 %%9 >>%1\godatman.bat
echo %1\datmanfe.exe -u  >%1\nodatman.bat
echo %1\loadaspi.exe -u >>%1\nodatman.bat
echo DATMAN Installation complete.
echo.
echo CAUTION: Don't forget to include "%1" in the PATH= setting.
echo          The GODATMAN.BAT file created in %1 is only a template.
echo          Please edit the batch file in order to load your ASPI file.
echo.
chdir %1
goto end
:help
echo Needs the target directory where the DATMAN files wil be installed.
:usage
echo.
echo Usage: (drv:)INSTALL path     ; Where  drv is the floppy drive
echo                               ;        path is the destination directory.
echo                               ; Note:  path must start with the drive name.
echo.
echo Example: A:INSTALL C:\DATMAN  ; Always start with the drive letter...
echo                               ; Don't end with '\' for proper installation
echo.
:end
