home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Supreme Volume 6 #1
/
swsii.zip
/
swsii
/
195
/
DR6UP2.ZIP
/
DR6UP2.EXE
/
OPEN_UP.EXE
/
UPDATE.BAT
< prev
next >
Wrap
DOS Batch File
|
1992-04-07
|
7KB
|
285 lines
@echo off
if not "%OS%" == "DRDOS" goto error4
if not "%VER%" == "6.0" goto error4
echo UPDATE R3.01 DR DOS File Update Utility
echo Copyright (c) 1990,1991 Digital Research Inc. All rights reserved.
if "%1" == "/H" goto showhelp
if "%1" == "/h" goto showhelp
if "%1" == "/?" goto showhelp
if "%1" == "" goto showhelp
set SYSDRV=0123456789012345678901234567890123456789
if not "%SYSDRV%" == "0123456789012345678901234567890123456789" goto error2
set SYSDRV=
if "%1"=="a:" set SYSDRV=A:
if "%1"=="A:" set SYSDRV=A:
if "%1"=="b:" set SYSDRV=B:
if "%1"=="B:" set SYSDRV=B:
if "%1"=="c:" set SYSDRV=C:
if "%1"=="C:" set SYSDRV=C:
if "%1"=="d:" set SYSDRV=D:
if "%1"=="D:" set SYSDRV=D:
if "%1"=="e:" set SYSDRV=E:
if "%1"=="E:" set SYSDRV=E:
if "%1"=="f:" set SYSDRV=F:
if "%1"=="F:" set SYSDRV=F:
if "%1"=="g:" set SYSDRV=G:
if "%1"=="G:" set SYSDRV=G:
if "%1"=="h:" set SYSDRV=H:
if "%1"=="H:" set SYSDRV=H:
if "%1"=="i:" set SYSDRV=I:
if "%1"=="I:" set SYSDRV=I:
if "%1"=="j:" set SYSDRV=J:
if "%1"=="J:" set SYSDRV=J:
if "%1"=="k:" set SYSDRV=K:
if "%1"=="K:" set SYSDRV=K:
if "%1"=="l:" set SYSDRV=L:
if "%1"=="L:" set SYSDRV=L:
if "%1"=="m:" set SYSDRV=M:
if "%1"=="M:" set SYSDRV=M:
if "%1"=="n:" set SYSDRV=N:
if "%1"=="N:" set SYSDRV=N:
if "%1"=="o:" set SYSDRV=O:
if "%1"=="O:" set SYSDRV=O:
if "%1"=="p:" set SYSDRV=P:
if "%1"=="P:" set SYSDRV=P:
if "%1"=="q:" set SYSDRV=Q:
if "%1"=="Q:" set SYSDRV=Q:
if "%1"=="r:" set SYSDRV=R:
if "%1"=="R:" set SYSDRV=R:
if "%1"=="s:" set SYSDRV=S:
if "%1"=="S:" set SYSDRV=S:
if "%1"=="t:" set SYSDRV=T:
if "%1"=="T:" set SYSDRV=T:
if "%1"=="u:" set SYSDRV=U:
if "%1"=="U:" set SYSDRV=U:
if "%1"=="v:" set SYSDRV=V:
if "%1"=="V:" set SYSDRV=V:
if "%1"=="w:" set SYSDRV=W:
if "%1"=="W:" set SYSDRV=W:
if "%1"=="x:" set SYSDRV=X:
if "%1"=="X:" set SYSDRV=X:
if "%1"=="y:" set SYSDRV=Y:
if "%1"=="Y:" set SYSDRV=Y:
if "%1"=="z:" set SYSDRV=Z:
if "%1"=="Z:" set SYSDRV=Z:
if "%SYSDRV%" == "" goto error3
set SWCH=/r
if "%SYSDRV%" == "A:" goto floppy
if "%SYSDRV%" == "B:" goto floppy
set SYSDIR=DRDOS
goto hard
:floppy
echo
echo Updating files for a floppy based system on drive %SYSDRV%
echo
:loop0
set DISKNAME=STARTUP
set IDFILE=command.com
gosub insert_disk
gosub update_files
if exist %SYSDRV%\install.exe copy util\setup.exe %SYSDRV%\install.exe >NUL
set DSKTYPE=360
if exist %SYSDRV%\emm386.sys set DSKTYPE=720
if exist %SYSDRV%\lock.exe set DSKTYPE=1.2/1.44
if "%DSKTYPE%" == "1.2/1.44" goto vmax_disk
set DISKNAME=UTILITITES-1
set IDFILE=emm386.sys
if "%DSKTYPE%" == "720" set IDFILE=editor.exe
gosub insert_disk
gosub update_files
if exist %SYSDRV%\install.exe copy util\setup.exe %SYSDRV%\install.exe >NUL
set DISKNAME=UTILITITES-2
set IDFILE=mem.exe
if "%DSKTYPE%" == "720" set IDFILE=sstor.exe
gosub insert_disk
gosub update_files
if "%DSKTYPE%" == "720" goto vmax_disk
set DISKNAME=UTILITITES-3
set IDFILE=lock.exe
gosub insert_disk
gosub update_files
set DISKNAME=UTILITITES-4
set IDFILE=print.com
gosub insert_disk
gosub update_files
set DISKNAME=UTILITITES-5
set IDFILE=recover.com
gosub insert_disk
gosub update_files
:vmax_disk
set DISKNAME=VIEWMAX
set IDFILE=viewmax.exe
gosub insert_disk
gosub update_files
:floppyend
if not exist update.1 goto success
gosub swap_disk
goto loop0
:hard
if "%2" == "" goto skip1
if "%2" == "/S" goto repall
if "%2" == "/s" goto repall
set SYSDIR=%2
if "%SYSDIR%" == "\" set SYSDIR=.
:skip3
if "%3" == "/S" goto repall
if "%3" == "/s" goto repall
goto skip1
:repall
set SWCH=/r /s
set SYSDIR=.
echo
echo WARNING: You have specified to update all copies of the relevant files
echo on drive %SYSDRV%. UPDATE will NOT check if the files are DR DOS files.
goto skip2
:skip1
echo
if "%SYSDIR%" == "." echo Updating DR DOS files on drive %SYSDRV%
if not "%SYSDIR%" == "." echo Updating DR DOS files in directory %SYSDIR% on drive %SYSDRV%
:skip2
echo
echo Press CTRL-C now if this is not correct and enter UPDATE /H for more
echo information.
echo
pause
if "%SYSDIR%" == "." goto skiptest
if not exist %SYSDRV%\%SYSDIR%\hidos.sys goto error
:skiptest
rem ** determine if there's a swapped sstor drive
rem ** this will result in SET SWAPDRV=NONE or SET SWAPDRV=d:
sstorchk
:loop1
echo Updating files...
replace @util.fl %SYSDRV%\%SYSDIR% %SWCH% >NUL
replace @sys.fl %SYSDRV%\ /r /h >NUL
if not exist sys\command.com goto skip_cmd
if not exist %COMSPEC% goto skip_cmd
copy sys\command.com %COMSPEC% >nul
:skip_cmd
if "%SWAPDRV%" == "NONE" goto almost
replace @util.fl %SWAPDRV%\%SYSDIR% %SWCH% >NUL
replace @sys.fl %SWAPDRV%\ /r /h >NUL
:almost
if not exist update.1 goto success
gosub swap_disk
goto loop1
:success
echo
echo UPDATE completed successfully.
goto exit
:insert_disk
echo Insert either your master %DISKNAME% disk or your
echo working %DISKNAME% disk in drive %SYSDRV%
echo If it is the master disk ensure the physical write protection is removed.
echo
pause
if exist %SYSDRV%\%IDFILE% return
echo ERROR: Wrong disk in drive %SYSDRV%
echo
goto insert_disk
:update_files
echo Updating files...
replace @util.fl %SYSDRV% /r >NUL
replace @sys.fl %SYSDRV% /r /h >NUL
echo
return
:swap_disk
echo Insert Update Disk #2
echo
pause
if exist update.2 return
echo ERROR: Wrong Update Disk in drive %SYSDRV%
echo
goto swap_disk
:update_files
:error
echo
echo ERROR: The drive/directory specified does not contain DR DOS files.
echo
goto exit
:error2
echo
echo ERROR: There is insufficient environment space to run this batch file.
echo Increase the environment space and try again.
echo
goto exit
:error3
echo
echo ERROR: Invalid drive specifier. Enter UPDATE /H for more information.
echo
goto exit
:error4
echo
echo ERROR: Incompatible operating system. Update requires DR DOS 6.0.
echo
goto exit
:showhelp
echo
echo UPDATE will replace DR DOS files on your hard disk or floppy disks with the
echo updated versions contained on this floppy disk.
echo
echo UPDATE d: [directory] [/S]
echo
echo d: Drive to update. (A: B: or C:)
echo directory Directory where DR DOS files are located.
echo /S Update all copies of the relevant files on the hard disk specified.
echo WARNING: This option DOES NOT check that the files being updated
echo are DR DOS files.
echo
echo For example UPDATE C: OSFILES will cause the files in the directory C:\OSFILES
echo to be updated.
echo
echo If you specify a floppy drive UPDATE will prompt you for each disk as it is
echo required. The disks can be either the master disks or your working disks if
echo if you have a twin drive floppy based system.
echo
:exit
rem set SYSDRV=
rem set SYSDIR=
rem set SET720=
rem set SWCH=
rem set SWAPDRV=
rem set DISKNAME=
rem set IDFILE=
rem set DSKTYPE=