rem              CCI install batch file   08-30-95
@echo off
case off
cls
If "%2"=="" goto ERROR
If "%1"=="XMCOPY" goto DISKCOPY
If "%1"=="XM" goto PREPARE
goto ERROR
:PREPARE
rem path a:\
if not exist %2:\CCPM.SYS goto firsttime
cls
echo.
echo.
echo.
echo.
echo.
echo.
echo.
@echo          You are going to install over an existing CDOS system.
echo.
@echo          To abort, CONTROL-C now and abort this batch file.
echo.
echo           To read about the latest changes, hit F1
echo.
inputx "Waiting for you to decide ....." resp
if "%RESP%"=="003" goto abort
if "%RESP%"=="187" goto show_new
:firsttime
cls
echo.
echo.
echo.
echo.
goto skip_read
:show_new
type mustread.doc /p
inputx "Just hit any key to continue or F9 to abort" resp
if "%RESP%"=="195" goto abort
cls
:skip_read
rem old starts here
echo.
echo Please wait ......
echo.
md %2:\cdos >nul
md %2:\cdos\spool >nul
md %2:\cdos\mail >nul
md %2:\cdos\security >nul
if NOT direxist %2:\cdos goto failure
%2:
cd \cdos
%3:attrib -r -s -h %2:*.* >nul
copy %3:installh.bat cdos$$$.bat >nul
cdos$$$ XMCOPY %2 %3
exit
:ERROR
echo.
echo	Improper parameters:  should be INSTALLH XM <dest> <source>
echo.
echo	like:  INSTALLH XM C A
echo.
Echo Reboot your system to execute the installation procedure.
echo.
Exit
:DISKCOPY
cls
echo.
if exist %3:CCI001.CCI goto found1
Echo Insert the CCI Concurrent DOS Startup Disk in drive %3:
echo or just hit any key if you are SURE it is there now.
echo.
Pause
cls
:found1
echo.
echo.
echo.
Echo ******************** Installh.bat Release 08/30/95 ***************************
Echo This procedure will install CCI Concurrent DOS on your hard disk drive %2:
Echo in the subdirectory %2:\CDOS.
Echo.
Echo It is advisable to make a temporary backup of any old pCDOSq files in the root 
Echo directory since we will be re-naming or deleting some of them.
echo.
Echo We may be adding 3 lines to the beginning of Autoexec.bat, but no other
Echo changes are made to your DOS programs.  Subdirectories have already been
Echo created: rCDOS, CDOS\MAIL, &  SECURITYu.  The \CDOS\SPOOL directory is
Echo for CSPOOL.  If there is not at least 4Mb of free space on your drive %2, this
Echo installation will fail.  You can check the remaining space on your drive by
Echo hitting rCtrlu and the r2u on your rnumeric keypadu, then %2:, then DIR.
Echo To return to this console, hit rCtrlu and r1u.
Echo ******************************************************************************
echo.
If exist %3:CCI001.CCI goto PAUSE1
echo There seems to be some reason that the file CCI001.CCI can not
echo found or created on drive %3:.  This file is needed to install
echo the operating system.
echo.
Pause
goto DISKCOPY
:PAUSE1
Pause
cls
echo Thank you, Please wait.
echo.
Echo Copying files...
if exist %2:\ccpm.sys ren setup.cmd setup.old >nul
if exist %2:\ccpm.sys ren config.exe config.old >nul
copy %3:*.*
If not exist CCI001.CCI goto FAILURE
:PROMPT2
cls
echo.
inputx "Place the Utilities Disk 2 in drive %3 then hit any key" resp
cls
echo Thank you, Please wait.
echo.
echo.
echo.
echo.
echo	 pThis floppy has one file that may take 90 seconds to copy.q
If exist %3:CCI002.CCI goto GO_TWO
echo.
echo.
echo	We will try once more to verify that you have changed disks.  You
echo	may have a bad disk change line.  Please run your diagnostics on
echo	the floppy disk.  To continue, we will force a disk-change signal
echo	after you hit any key.
echo.
echo.
pause
chkdsk %3: >nul
If not exist %3:CCI002.CCI goto PROMPT2
:GO_TWO
echo.
Echo Copying files...
copy %3:*.*
If not exist CCI002.CCI goto FAILURE
rem
rem	now we extract the lzh file
call extract.bat
rem	this will pause if an error happens
:PROMPT3
cls
echo.
inputx "Place the Utilities Disk 3 in drive %3 then hit any key" resp
cls
echo Thank you, Please wait.
If exist %3:CCI003.CCI goto GO_THREE
echo.
echo.
echo	We will try once more to verify that you have changed disks.  You
echo	may have a bad disk change line.  Same story as disk 2.
echo.
pause
chkdsk %3: >nul
If not exist %3:CCI003.CCI goto PROMPT3
:GO_THREE
echo.
Echo Copying files...
copy %3:*.*
If not exist CCI003.CCI goto FAILURE
rem *** ibid change:
call extract3.bat
cls
:floppy_done
echo.
Echo All files have been copied, now deleting or renaming some old files. 
echo.
ren %2:\*.old *.xyz >nul
ren %2:\config.exe config.old >nul
ren %2:\cconfig.sys cconfig.old >nul
ren %2:\start*.bat start*.old >nul
if not exist %2:\cdos\spool\config.cpl goto nospool
SET SPOOLNEW=YES >NUL
@echo.
@echo changing CONFIG.CPL to CONFIG.OLD for CSPOOL
@echo.
:nospool
copy %2:\cdos\spool\config.cpl %2:\cdos\spool\config.old >nul
copy config.cpl %2:\cdos\spool >nul
era config.cpl >nul
era cspool.cmd >nul
era cdspl.cmd >nul
era espl.cmd >nul
era chkdsk.exe >nul
era chkdsk.cmd >nul
era coms.cmd >nul
era backup.cmd >nul
era force.cmd >nul
era wmenu.cmd >nul
era window.cmd >nul
era reboot.cmd >nul
era reboot.exe >nul
era bwi.com >nul
loadsys install <cr >nul
cls
if "%2" NE "C" goto do_sys
:re_ask
echo.
@echo	You may now choose between using Loader or Loadsys.
@echo.
@echo	Choosing Loadsys will cause your Autoexec.Bat to be prefaced with
@echo	the Loadsys /Ask line and you will be prompted to load CCI
@echo	Concurrent DOS.
@echo.
@echo	Choosing Loader will modify your hard drive boot loader to allow
@echo	loading CCI Concurrent DOS before DOS loads.  With the supplied
@echo	BOOTCCI.TXT if you hit F1 you will load DOS.  If you hit F2 you
@echo	will load CCI Concurrent DOS.
@echo.
@echo	If you are using DOS 5 or 6, and are loading high memory drivers
@echo	in CONFIG.SYS, then use of Loader is recommended.
@echo.
@echo	Now hit:
@echo			F1 for Loader
@echo			F2 for Loadsys
@echo.
@echo			F3 to skip this step - use existing method
@echo.
inputx "Waiting for you to decide ....." resp
if "%RESP%"=="187" goto do_load
if "%RESP%"=="188" goto do_sys
if "%RESP%"=="189" goto load_done
cls
goto re_ask
:do_load
copy bootcci.txt c:\ >nul
cd \
\cdos\loader bootcci.txt
cd \cdos
goto load_done
:do_sys
@echo.
@echo.
Echo Installing Loadsys program for this computer hardware
attrib -r -h \loadsys.com >nul
copy loadsys.com \ >nul
if exist %2:\autoexec.bat goto adjust_auto >nul
goto no_auto
:adjust_auto
echo.
echo Adjusting Autoexec.Bat
cd \ >nul
%2:\cdos\lookauto >nul
cd \cdos >nul
if errorlevel == 2 goto no_auto
if errorlevel == 1 goto skip_it
goto no_loadsys
:skip_it
echo.
echo	skipping autoexec change since you have a loadsys there now
echo.
goto no_auto
:no_loadsys
attrib -r -h %2:\autoexec.bat >nul
ren %2:\autoexec.bat %2:\autoexec.old >nul
copy %2:\cdos\autoexec.new+%2:\autoexec.old %2:\autoexec.bat >nul
:no_auto
:load_done
@echo.
@echo.
@echo Fixing up directories
@echo.
cd o:=%2:\
attrib -r -h o:ccpm.sys >nul
ren o:ccpm.sys o:cci.sys >nul
era o:ccpm.sys >nul
copy ccpm.sys \*.* >nul
copy ccpm.sys ccpm.org >nul
era ccpm.sys >nul
copy start000.bat \*.* >nul
attrib -r -h o:cdos.com >nul
era o:cdos.com >nul
copy cdos.com o: >nul
copy cdos.com shell.com >nul
pifed shell.com /i lovector=0 hivector=E0 >nul
copy cconfig.sys o: >nul
if exist ?M.306 goto do_med
if exist ??M.306 goto do_med
if exist ???M.306 goto do_med
if exist ????M.306 goto do_med
if exist ?????M.306 goto do_med
goto done_med >nul
:do_med
copy cconfig.que o:cconfig.sys >nul
:done_med
@echo.
@echo		Doing some final cleanup
ren login.bat %2:\cdos\security >nul
ren sysop.bat %2:\cdos\security >nul
ren cciboot.bat %2:\cdos\security >nul
ren control.rem %2:\cdos\security >nul
copy security.exe %2:\cdos\security >nul
copy reboot.com %2:\cdos\security >nul
copy passcvt.exe %2:\cdos\security >nul
era login.bat >nul
era sysop.bat >nul
era pass.exe >nul
era passcvt.exe >nul
era reboot.com >nul
era security.exe >nul
copy %2:\security\control %2:\cdos\security >nul
copy %2:\security\passwd %2:\cdos\security >nul
copy %2:\security\*.bat %2:\cdos\security >nul
cd %2:\cdos\security >nul
if exist PASSWD passcvt >nul
era PASSWD >nul
cd \cdos
rendir %:\security %2:\security.old >nul
copy control.old %2:\cdos\security >nul
copy control.doc %2:\cdos\security >nul
era control.old >nul
era autoexec.new >nul
era start001.bat >nul
era cr >nul
era CCI002.CCI >nul
era CCI003.CCI >nul
era extract.bat >nul
call ldibid.bat %2 %3
era ldibid.bat >nul
cls
echo.
echo.
echo.
Echo			rInstallation complete.u
echo.
Echo			Open disk drive door and hit any key to reboot.
Echo			===============================================
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
pause
%2:\cdos\security\reboot
:abort
EXIT
:FAILURE
cls
echo 
echo.
echo.
echo.
echo The installation has failed.  You may not have enough room on drive %2:.
echo Please allow 4Mb for CCI Concurrent DOS and the utilities.  You can restart
echo this process by inserting the Startup Disk and rebooting the computer.
echo.
echo.
echo. It will also fail if we can not create a CDOS subdirectory.
echo.
pause