;/*
; *	@(#)install.dat	1.32	12/13/90 06:56:42
; */
;
;/*  Copyright 1990 by Locus Computing Corporation */
;
;
; Installation script for PC-Interface, aka AIX Access for DOS Users
;
; Get correct product name and release
;
callscript "%INSTDRIVE%PRODUCT.DAT"
;
; Default values
;
set src         "%INSTDRIVE%"
set dst		"C:\PCI\"
set driver	"DRIVERS\"
set tcp20id	"C:\TCP20.ID"
set 1diskid	"%INSTDRIVE%BIN\EM2.EXE"
set 2diskverid	"\BIN\EM2.EXE"
set sdiskid	"\BIN\VI.EXE"
set pdisk1	"Program Disk 1"
set pdisk2	"Program Disk 2"
set drdisktl	"Drivers Disk"
set sdisk	"Supplementary Disk"
set minimal	no
;
; set display colors appropriately for color or monochrome display
;
;goto %displaytype% mono
;colors work 0x17 menu 0x17 0x71 help 0x1e display 0x17 input 0x1e
;goto color
:mono
colors work 0x07 menu 0x70 0x07 help 0x0f display 0x07 input 0x0f
:color

newwork
helpline 16
work

%product%, Release %release%

%alt_copyrt%
Copyright 1984, 1985, 1986, 1987, 1988, 1989, 1990  Locus Computing Corporation
..
prompt ""
help
Use the up and down arrow keys or first letter of menu item 
to change your selection.
Press ENTER to choose the current selection.

"Continue" will install %product% on your hard disk
from the distribution diskettes.

"Quit" will cancel the installation program.
..
menu insttype 8 28
" Continue "	full
" Quit "	quit
..
goto %insttype% quit
newwork
work
	    Before continuing with installation, make sure
	    you have answers to the following questions:

- In what directory do you want %product% installed? 
  (you must have 950K bytes of free disk space for a complete installation)
- What type of network interface and with what options are you using? 
- What is your computer's internet address?
- Is Locus TCP/IP For DOS or IBM TCP/IP for IBM X-Windows for IBM DOS 
  installed on your computer?
..
prompt ""
help
Use the up and down arrow keys or first letter of menu item
to change your selection.
Press ENTER to choose the current selection.

"Continue" will install %product% on your hard disk
from the distribution diskettes.

"Quit" will cancel the installation program.
..
menu insttype 12 30
" Continue "	full
" Quit"		quit
..
goto %insttype% quit
:askagain
set minimal	no
set floppyinstall no
newwork
prompt "Destination directory:    "
help
Enter the drive and directory where you want %product% installed.

You may edit the directory name with these keys:

left arrow - move cursor left          right arrow - move cursor right
home       - go to beginning of line   end         - go to end of line
backspace  - delete before cursor      del         - delete at cursor
ins        - toggle insert mode        esc         - clear input
..
:askdest
indir dirvar "%dst%" invdir
goto skip
:editdst
indir dirvar "%dirvar%" invdir
:skip
checkdrive drive "%dirvar%"
goto %drive%1 baddrive1
goto checkpath
:baddrive1
parsepath dstdrv "%dirvar%" "d:"
display

Drive %dstdrv% does not exist.
..
goto editdst
:longpath
display

Your PATH is too long to add the directory you specified.  If you wish to
have %product% commands in your searchpath, you will need
to remove one or more directories from your searchpath and then add the
%product% bin directory.  Consult your DOS documentation
for information on how to do this.

Do you wish to continue the installation?
..
help
Choose "Continue" to continue the %product% installation.

Choose "Quit" to cancel installation.
..
menu longpath 11 28
" Continue "	continue
" Quit "	quit
..
goto "%longpath%" quit
..
:checkpath
; The three asterisks below are place holders for two variables to be used in
; path assignments, %path% and %pcipath%.  Under DOS, the number of characters
; allowed in a path assignment depends on the number of variables invoked in
; that path assignment.  And %path% itself seems to count double?
addpath pathtmp "***%path%" "%dirvar%\bin" longpath
:continue
set dst "%dirvar%"
check ddtype "%dst%"
goto %ddtype%1 nodir1
display

The directory %dst% exists.
Do you wish to install over it?
..
help
Choose "Yes" and %product% will be installed over %dst%.

Choose "No" and the question will be asked again with your previous
answer as default.

Choose "Quit" to cancel installation.
..
menu ddcheck 4 35
" No "          askdest
" Yes "         ddok
" Quit "        quit
..
display
..
goto %ddcheck% askdest quit
:nodir1
;
; if we are installing on b: force a minimal installation
;
parsepath dstdrv "%dst%" "d"
goto %dstdrv%drv Bdrv
goto %dstdrv%drv Adrv
set floppyinstall no
goto review
:Bdrv
:Adrv
set floppyinstall yes
; dtermine if we are installing to a dual floppy
display

Does your PC have two diskette drives?
..
help
Choose "Yes" if your PC has two diskette drives.

Choose "No" if your PC has a single diskette drive.
..
menu floppy 3 42 "%floppy%"
" Yes "		2floppy
" No "		1floppy
..
goto %floppy% 1floppy
; there are two floppy drives
display
..
goto review
:1floppy
; 1 floppy drive; force a minimal install
display

Do you want to install a minimal %product% system?
..
help
Choose "Yes" and a minimal %product% system will be installed.

Choose "Quit" to cancel installation.
..
menu yorq 3 56
" Yes "		yok
" Quit "	quit
..
goto %yorq% quit
display
..
; we are doing a minimal installation
set minimal yes
:review
display

Do you wish to change the above answer?
..
help
Choose "Yes" and the questions will be asked again with your previous
answers as defaults.

Choose "No" to proceed with the installation.

Choose "Quit" to cancel installation.
..
menu askagain 3 43
" Yes "         askagain
" No "          ansok
" Quit "        quit
..
display
..
help
..
goto %askagain% askagain quit
:nofile3
;
; Start installation
;
mkdir "%dst%"
mkdir "%dst%bin\"
set driverdst "%dst%%driver%"
mkdir "%driverdst%"
mkdir "%dst%dosmsg\"
mkdir "%dst%lib\"
; clear screen in case of installing from a: to b:
display
..
; check to see if we have 2 program disk or just one
check 1disk "%1diskid%"
goto %1disk%1disk file1disk
; there are 2 program disks
set 2disks yes
goto goingon
:file1disk
; there is only one program disk
set 2disks no
:goingon
set idfile "install.dat"
set disktitle "%pdisk1%"
call getdisk
prompt " "
prompt "       Copying: "
; if minimal installation there is going to be a lot
; of floppy swaps, don't display the "don't remove diskette"
; message and set helpline to 0
goto %minimal%21 no21
helpline 0
goto copyit1
:no21
help


		Copying in progress - do not remove diskette.
..
:copyit1
; first write serial number file
spawn "%INSTDRIVE%locus.exe %dst%\bin\bridge.dat"
goto serial0 serial%errorlevel%
goto serial1 serial%errorlevel%
show "Error creating or writing serial number file"
goto quit
:serial1
prompt " Installation Diskette corrupt."
helpline 0
help



		Your installation diskette is corrupt.
		Please contact your vendor.
..
goto quit
:serial0
;
; first copy minimal configuration
copy "%src%bin\login.exe" "%dst%bin\" display copyerr
copy "%src%bin\pciinit.exe" "%dst%bin\" display copyerr
copy "%src%bin\logout.exe" "%dst%bin\" display copyerr
copy "%src%bin\pciconf.exe" "%dst%bin\" display copyerr
copy "%src%bin\printer.exe" "%dst%bin\" display copyerr
copy "%src%bin\bridge.drv" "%driverdst%" display copyerr
copy "%src%dosmsg\*.*" "%dst%dosmsg\" display copyerr
; restore help area
helpline 16
goto %minimal%min yesmin
; not a minimal installation, copy lib directory
copy "%src%lib\*.*" "%dst%lib\" display copyerr
goto %2disks%2 no2
set idfile "%2diskverid%"
set disktitle "%pdisk2%"
call getdisk
prompt " "
prompt "       Copying: "
:no2
; copy the rest of *.exe files
help


		Copying in progress - do not remove diskette.
..
copy "%src%bin\udir.exe"	"%dst%bin\" display copyerr
copy "%src%bin\charconv.exe"	"%dst%bin\" display copyerr
copy "%src%bin\doswhat.exe"	"%dst%bin\" display copyerr
copy "%src%bin\pcidebug.exe"	"%dst%bin\" display copyerr
copy "%src%bin\on.exe"		"%dst%bin\" display copyerr
copy "%src%bin\em2.exe"		"%dst%bin\" display copyerr
; copy jobs.exe, kill.exe, dos2unix.exe, unix2dos.exe
show "JOBS.EXE"
copy "%dst%bin\on.exe" "%dst%bin\jobs.exe" copyerr
show "KILL.EXE"
copy "%dst%bin\on.exe" "%dst%bin\kill.exe" copyerr
show "DOS2%ix%.EXE"
copy "%dst%bin\charconv.exe" "%dst%bin\dos2%ix%.exe" copyerr
show "%ix%2DOS.EXE"
copy "%dst%bin\charconv.exe" "%dst%bin\%ix%2dos.exe" copyerr
;
; supplementary diskette
;
goto %havesdisk%sdisk nosdisk
set idfile "%sdiskid%"
set disktitle "%sdisk%"
call getdisk
prompt " "
prompt "       Copying: "
help


		Copying in progress - do not remove diskette.
..
copy "%src%bin\*.*" "%dst%bin\" display copyerr
:nosdisk
:yesmin
;
; minimum installation, go on to drivers
;
; call script to install network interface
;
set idfile "instdr.dat"
set disktitle "%drdisktl%"
call getdisk
call pleasewait
callscript "%src%instdr.dat"
;
;
;
:quit
exit
:invdir
display

            Invalid directory name: %dirvar%
..
..
:copyerr
display

    Error: %errmsg%: %errfile%

..
menu errmen -3 40
" Continue "    errcont
" Quit "       errabort
..
goto %errmen% errcont
exit 1
:errcont
display
..
..
;
; Subroutine to verify diskette
;
:getdisk
check diskfile "%src%%idfile%"
goto %diskfile% file
newwork
work

Insert "%disktitle%" and press ENTER to continue.

..
Prompt "Diskette Drive: "
help
You may edit the name of the diskette drive with these keys:

left arrow - move cursor left          right arrow - move cursor right
home       - go to beginning of line   end         - go to end of line
backspace  - delete before cursor      del         - delete at cursor
ins        - toggle insert mode        esc         - clear input
..
:getdisk10
indir dirvar "%src%" invdir
set src "%dirvar%"
check diskfile "%src%%idfile%"
goto %diskfile% file
display

Wrong disk in %src%.
..
goto getdisk10
:file
..
:pleasewait
prompt " "
prompt "	Reading driver information ..."
help


		This may take several seconds.
..
