set quiet
echo ************************************************************************
echo * This is the automated installation process for the turnkey RSTS/E    *
echo * system. Once the installation procedure has completed, the following *
echo * software will be available:                                          *
echo *      1. RSTS/E v10.1-L                                               *
echo *      2. DECnet-E v4.1                                                *
echo *      3. DECmail-11 v3.1-00.03                                        *
echo *      4. FMS-11 v2.1                                                  *
echo *      5. BASIC-PLUS 2 v2.7A                                           *
echo *      6. COBOL-81 v2.3                                                *
echo *      7. PDP-11 C v1.2-006                                            *
echo *      8. FORTRAN IV v2.8                                              *
echo *      9. FORTRAN-77 v5.4                                              *
echo *     10. DIBOL v6.1-F                                                 *
echo ************************************************************************
detach DMC0
set TTI 7P
set TTO 7B
set TS0 LOCK
set DMC0 PEER=127.0.0.1:65535
mkdir dsk
attach HK0 -iy dsk/rsts0.dsk
attach HK1 -iy dsk/rsts1.dsk
attach DMC0 65535
:SETUP
set ENV -p "System ([1,2]) Password" SYSPWD=Digital1977
set ENV -p "Administrator ([1,4]) Password" ADMPWD=Digital1977
set ENV -p "Administrator Full Name (31 characters)" NAME=Dave N. Cutler
set ENV -P "Administrator Short Name (13 characters)" EMAIL=DCUTLER
set ENV -p "Installation Name (15 characters)" SYSNAME=RSTS/E V10.1-L
set ENV -p "Installation TELEX Answerback  (24 characters)" TELEX=RSTS/E V10.1-L
set ENV -p "DECnet Name" SCSNODE=RSTS10
set ENV -p "DECnet Area" AREA=1
set ENV -p "DECnet Node" NODE=11
echo ************************************************************************
set ENV -p "Central VAX DECnet Node Name" CENTRALNAME=795VAX
echo Central VAX DECnet Area >%AREA%<
set ENV -p "Central VAX DECnet Node" CENTRALNODE=795
echo ************************************************************************
set ENV -p "Are you satisfied with your setup options? [Y/N]" REDOSETUP=N
if -i REDOSETUP geq "Y" goto EOI
else goto SETUP
:EOI
echo ************************************************************************
echo * End of user input; please wait until the installation is complete.   *
set CONSOLE LOG=install%PFX%.log
;
; Post-questionnaire, pre-install tasks
;
echo ************************************************************************
echo *     INSTALLATION STARTED AT %TIME%                                 *
echo ************************************************************************
set ENV NODEDB=1536
;
; Perform RSTS/E v10.1-L System Generation
;     Phase I
;
:SYSGEN1
noexpect
attach TS0 -er dist/rstse_v10_1.tap
expect "Today's date? " send "%DATE_DD%-%DATE_MMM%-%DATE_YY%\r"; continue
expect "Current time? " send "%TIME_HH%:%TIME_MM%\r"; continue
expect "Installing RSTS on a new system disk? <Yes> " send "\r"; continue
expect "Disk? " send "DM0\r"; continue
expect "Pack ID? " send "SYSTEM\r"; continue
expect "Pack cluster size <1>? " send "\r"; continue
expect "MFD cluster size <16>? " send "\r"; continue
expect "SATT.SYS base <26875>? " send "\r"; continue
expect "Pre-extend directories <NO>? " send "\r"; continue
expect "PUB, PRI, or SYS <SYS>? " send "\r"; continue
expect "[1,1] cluster size <16>? " send "\r"; continue
expect "[1,2] cluster size <16>? " send "\r"; continue
expect "[1,1] and [1,2] account base <26875>? " send "\r"; continue
expect "Date last modified <YES>? " send "\r"; continue
expect "New files first <NO>? " send "\r"; continue
expect "Read-only <NO>? " send "\r"; continue
expect "Format <NO>? " send "yes\r"; continue
expect "Patterns <3>? " send "\r"; continue
expect "Proceed (Y or N)? " send "y\r"; continue
expect "Installation device? <_MS0:> " send "\r"; continue
expect "Are you ready to proceed? <yes> " send "\r"; continue
expect "Target disk? <_SY:> " send "\r"; continue
expect "Do you want to install the RSTS/E monitor? <yes> " send "\r"; continue
expect "Please type A or B <A> " send "\r"; continue
expect "Use template monitor ?          <N >    " send "\r"; continue
expect "New Monitor name ?              <RSTS>  " send "\r"; continue
expect "Accept defaults ?               <N >    " send "\r"; continue
expect "Accept Disk defaults ?          <N >    " send "\r"; continue
expect "RK05's ?                        <00>    " send "\r"; continue
expect "RL01/RL02's ?                   <00>    " send "\r"; continue
expect "RK06/RK07's ?                   <02>    " send "\r"; continue
expect "Overlapped seek ?               <Y >    " send "\r"; continue
expect "Disks on DR controller ?        <00>    " send "\r"; continue
expect "Disks on DB controller ?        <00>    " send "\r"; continue
expect "MSCP support ?                  <N >    " send "\r"; continue
expect "Accept Peripheral defaults ?    <N >    " send "\r"; continue
expect "TU16/TE16/TU45/TU77's ?         <00>    " send "\r"; continue
expect "TU10/TE10/TS03's ?              <00>    " send "\r"; continue
expect "TS11/TK25/TSV05/TU80's ?        <01>    " send "\r"; continue
expect "TMSCP tape drives ?             <00>    " send "\r"; continue
expect "Printers ?                      <01>    " send "\r"; continue
expect "RX01/RX02's ?                   <00>    " send "\r"; continue
expect "CR11/CM11 card reader ?         <Y >    " send "\r"; continue
expect "CD11 card reader ?              <N >    " send "\r"; continue
expect "Card decode ?                   <ANSI>  " send "\r"; continue
expect "DMC11's/DMR11's ?               <01>    " send "\r"; continue
expect "DMV11's/DMP11's ?               <00>    " send "\r"; continue
expect "IBM 3271 or 2780/3780 simultaneous links ?      <00>    " send "\r"; continue
expect "RJ2780 support ?                <N >    " send "\r"; continue
expect "Accept Software defaults ?      <N >    " send "\r"; continue
expect "Maximum jobs ?                  <25>    " send "32\r"; continue
expect "Small buffers ?                 <500>   " send "640\r"; continue
expect "EMT Logging ?                   <N >    " send "y\r"; continue
expect "Are you ready to proceed? <yes> " send "\r"; continue
expect "Do you want to install the System Program packages? <yes> " send "\r"; continue
expect "Packages to install <ALL> : " send "\r"; continue
expect "Is this list OK? <yes> " send "\r"; continue
expect "Do you want the I&D versions of tasks? <Y> " send "\r"; continue
expect "Use resident library version of RMS? <Y> " send "\r"; continue
expect "Use RMS resident libraries in DAP? <Y> " send "\r"; continue
expect "Use RMS resident libraries in PBS? <Y> " send "\r"; continue
expect "Use resident library version of EDT? <Y> " send "\r"; continue
expect "Are you ready to proceed? <yes> " send "\r"; continue
expect "Do you wish to do the transfer? <Yes> " send "\r"; continue
expect "Product updates to transfer? <ALL> : " send "\r"; continue
expect "Is this list OK? <yes> " send "\r"; continue
expect "Patch account? <PATCH$$:> " send "\r"; continue
expect "New password: " send "%SYSPWD%\r"; continue
expect "New password again, for verification: " send "%SYSPWD%\r"; continue
expect "Are you ready to proceed? <yes> " send "\r"; continue
expect "What size would you like SWAPMAX to be? <66> " send "\r"; continue
expect "Do you want _SY0:[0,1]SWAP1.SYS created (at 8184 blocks)? <yes> " send "no\r"; continue
expect "New BASIC-PLUS RTS name ?       <BASIC> " send "\r"; continue
expect "Accept defaults ?               <N>     " send "\r"; continue
expect "Floating Point Processor ?      <Y>     " send "\r"; continue
expect "Math precision ?                <2>     " send "4\r"; continue
expect "Log functions ?                 <Y>     " send "\r"; continue
expect "Trig functions ?                <Y>     " send "\r"; continue
expect "Print using ?                   <Y>     " send "\r"; continue
expect "Matrices ?                      <N>     " send "y\r"; continue
expect "String arithmetic ?             <N>     " send "y\r"; continue
expect "Debug ?                         <N>     " send "\r"; continue
expect "Old-style SEND/RECEIVE ?        <N>     " send "y\r"; continue
expect "Create another BASIC-PLUS RTS ? <N>     " send "\r"; continue
expect "Do you want to proceed with the default installation             <YES>? " send "n\r"; continue
expect "Do you want to change the default task size                       <NO>? " send "\r"; continue
expect "Do you want to change any of the default runtime options          <NO>? " send "y\r"; continue
expect "Do you want to change the default collating sequence              <NO>? " send "\r"; continue
expect "Should SORT/MERGE eliminate duplicate records by default          <NO>? " send "\r"; continue
expect "Do you wish the default to be a stable SORT/MERGE                 <NO>? " send "\r"; continue
expect "Do you want to change the SORT default split                      <NO>? " send "\r"; continue
expect "Do you want to change the MERGE default split                     <NO>? " send "\r"; continue
expect "Do you wish to change the default number of work files            <NO>? " send "\r"; continue
expect "Do you wish to change the default SORT process                    <NO>? " send "\r"; continue
expect "otherwise answer NO.                                              <NO>? " send "\r"; continue
expect "Do you want to change the number of retries                       <NO>? " send "y\r"; continue
expect "re-read a locked bucket                                         <2000>? " send "9999\r"; continue
expect "cluster library                                                   <NO>? " send "y\r"; continue
expect "ARE THE ABOVE DEFAULTS THE DESIRED ONES    <YES or NO>           <YES>? " send "\r"; continue
expect "Would you like to start your new monitor now? <Y> " send "\r"; continue
expect "Proceed with system startup? <YES> " send "n\r"; continue
expect "$ " send "set account/name=\"SYSTEM\" [1,2]\r"; continue
expect "$ " send "run $dskint\r"; continue
expect "Disk? " send "dm1\r"; continue
expect "Pack ID? " send "EXTEND\r"; continue
expect "Pack cluster size <1>? " send "\r"; continue
expect "MFD cluster size <16>? " send "\r"; continue
expect "SATT.SYS base <26875>? " send "\r"; continue
expect "Pre-extend directories <NO>? " send "\r"; continue
expect "PUB, PRI, or SYS <PRI>? " send "pub\r"; continue
expect "Create account [1,1] <NO>? " send "\r"; continue
expect "Create account [1,2] <NO>? " send "\r"; continue
expect "Date last modified <YES>? " send "\r"; continue
expect "New files first <NO>? " send "\r"; continue
expect "Read-only <NO>? " send "\r"; continue
expect "Patterns <3>? " send "\r"; continue
expect "Proceed (Y or N)? " send "y\r"; continue
expect "$ " send "mount/public _dm1: extend sys002\r"; continue
expect "$ " send "install/swap_file=1/position=middle/size=3960 _dm0:\r"; continue
expect "$ " send "install/swap_file=3/position=middle/size=4224 _dm1:\r"; continue
expect "$ " send "install/library EDT$:EDT\r"; continue
expect "$ " send "create/account/name=\"Operator\"/template=sy:[1,2]/nodialup/nonetwork/nopassword_prompt _dm0:[1,3]\r"; continue
expect "$ " send "copy [0,1]start.com [1,3]start.com\r"; continue
expect "$ " send "edit [1,3]start.com\r"; goto CONFIG1
boot TS
goto EOS
;
; Initial START.COM Configuration
;
:CONFIG1
noexpect 
expect "*" send "replace 52 ;$ VIRTUAL_DISK := YES\r"; continue
expect "*" send "replace 53 ;$ ! VIRTUAL_DISK := NO\r"; continue
expect "*" send "replace 59 ;$ _create/virtual 224\r"; continue
expect "*" send "replace 60 ;$ ! Create a 224 block virtual disk\r"; continue
expect "*" send "replace 61 ;$ ! This will use 56KW of memory\r"; continue
expect "*" send "replace 118 ;$ _install/swapfile=3 _DM1:[0,1]SWAP3.SYS\r"; continue
expect "*" send "replace 127 ; set system/label=ansi\r"; continue
expect "*" send "replace 129 ; set system/name=\"%SYSNAME%\"\r"; continue
expect "*" send "insert 130 ; set system/answerback=\"%TELEX%\"\r"; continue
expect "*" send "replace 131 ; set system/hangup=immediate\r"; continue
expect "*" send -t delay=100k "insert 133\r set system/emt_logging=all\r set system/statistics\r\032"; continue
expect "*" send "exit\r"; goto SYSGEN2
goto EOS
;
; Perform RSTS/E v10.1-L System Generation
;     Phase II
;
:SYSGEN2
noexpect
expect "$ " send "copy [1,3]start.com dm0:[0,1]start.com\r"; continue
expect "OK to replace existing file DM0:[0,1]START .COM ? " send "y\r"; continue
expect "$ " send "delete [1,3]start.com\r"; continue
expect "$ " send "create/account autoin$:\r"; continue
expect "$ " send "run $shutup\r"; continue
expect "Minutes until system shutdown (0-99) <5>?  " send "0\r"; continue
expect "Shutdown with automatic RESTART <NO>?  " send "y\r"; continue
expect "Proceed with system startup? <YES> " send "\r"; continue
expect "RSTS/E is on the air..." goto DECNET
goto EOS
;
; Perform DECnet/E v4.1 Installation
;
:DECNET
noexpect
expect "$ " send "@[0,1]install layered_products\r"; continue
expect "Are you ready to proceed? <yes> " send "\r"; continue
expect "Products to install: " send "decnet\r"; continue
expect "Patch account? <PATCH$:> " send "\r"; continue
expect "Is this list OK? <yes> " send "\r"; continue
expect "Target disk? <_SY:> " send "\r"; continue
expect "Are you ready to proceed? <yes> " send "\r"; continue
expect "DECNET Library device? <_MS0:> " attach TS0 -erf tpc dist/decnet-e_v4_1.tpc; send "\r"; continue
expect "Do you want to install the HELP files for NCP? (YES/NO) <YES> " send "\r"; continue
expect "Maximum area number in your network? (1-63) <1> " send "63\r"; continue
expect "Maximum number of nodes in your network? (1-26000) <256> " send "%NODEDB%\r"; continue
expect "Name of the executor node? (1-6 characters, e.g. ALPHA) " send "%SCSNODE%\r"; continue
expect "Address of the executor node? (area.node, e.g. 1.25) " send "%AREA%.%NODE%\r"; continue
expect "Do you want a DECnet default account? (YES/NO) <YES> " send "\r"; continue
expect "DECnet default account PPN? ([project-number,programmer-number]) " send "[3,254]\r"; continue
expect "Duplex mode of line DMC-0? (HALF or FULL) <FULL> " send "\r"; continue
expect "Do you want to define this node as a router? (YES/NO) <NO> " send "\r"; continue
expect "Are you ready to proceed with system shutdown? (YES/NO) <YES> " send "\r"; continue
expect "Allow Print/Batch Services jobs to complete <YES>?  " send "\r"; continue
expect "Minutes until system shutdown (0-99) <5>?  " send "0\r"; continue
expect "Shutdown with automatic RESTART <NO>?  " send "y\r"; continue
expect "Do you want to run the local node tests? (YES/NO) <YES> " send "\r"; continue
expect "Do you want to run the adjacent node test? (YES/NO) <YES> " send "\r"; continue
expect "Do you want to define any remote nodes? (YES/NO) <YES> " send "n\r"; continue
expect "Proceed with system startup? <YES> " send "\r"; continue
expect "RSTS/E is on the air..." goto DECMAIL
send -t after=250k "hello 1,3\r"
goto EOS
;
; Perform DECmail-11 v3.1-00.03 Installation
;
:DECMAIL
noexpect
expect "$ " send "@[0,1]install layered_products\r"; continue
expect "Are you ready to proceed? <yes> " send "\r"; continue
expect "Products to install: " send "mail\r"; continue
expect "Patch account? <PATCH$:> " send "\r"; continue
expect "Is this list OK? <yes> " send "\r"; continue
expect "Target disk? <_SY:> " send "\r"; continue
expect "Are you ready to proceed? <yes> " send "\r"; continue
expect "MAIL Library device? <_MS0:> " attach TS0 -erf tpc dist/decmail-11_v3_1.tpc; send "\r"; continue
expect "Apply updates (Y/N) <Y>: " send "\r"; continue
expect "The RSTS/E Software Installation Procedure is complete" goto CONFIG2A
send -t after=250k "hello 1,3\r"
goto EOS
;
; Add DM1: public structure mount to START.COM
;
:CONFIG2A
noexpect
expect "$ " send "copy [0,1]start.com [1,3]start.com\r"; continue
expect "$ " send "edit [1,3]start.com\r"; goto CONFIG2B
goto EOS
:CONFIG2B
noexpect
expect "*" send "insert 78\r$ mount/public DM1: EXTEND SYS002\r\032"; continue
expect "*" send "exit\r"; goto CONFIG2C
goto EOS
:CONFIG2C
noexpect
expect "$ " send "copy [1,3]start.com dm0:[0,1]start.com\r"; continue
expect "OK to replace existing file DM0:[0,1]START .COM ? " send "y\r"; continue
expect "$ " send "delete [1,3]start.com\r"; continue
expect "$ " attach TS0 -erf tpc dist/fortran-77_v5_4.tpc; send "restore ms0:aut101.a autoin$:\r"; continue
expect "Where can this volume be located? <MS0:> " send "\r"; continue
expect "$ " attach TS0 -erf tpc dist/fortran-77_v5_4.tpc; send "restore ms0:autver.bck autoin$:\r"; continue
expect "Where can this volume be located? <MS0:> " send "\r"; continue
expect "$ " send "run $shutup\r"; continue
expect "Allow Print/Batch Services jobs to complete <YES>?  " send "\r"; continue
expect "Minutes until system shutdown (0-99) <5>?  " send "0\r"; continue
expect "Shutdown with automatic RESTART <NO>?  " send "y\r"; continue
expect "Proceed with system startup? <YES> " send "\r"; continue
expect "RSTS/E is on the air..." goto FORTRAN
goto EOS
;
; Perform FORTRAN IV v2.8 Installation
;
:FORTRAN
noexpect
expect "$ " send "@[0,1]install layered_products\r"; continue
expect "Are you ready to proceed? <yes> " send "\r"; continue
expect "Products to install: " send "fortran\r"; continue
expect "Patch account? <PATCH$:> " send "\r"; continue
expect "Is this list OK? <yes> " send "\r"; continue
expect "Target disk? <_SY:> " send "\r"; continue
expect "Are you ready to proceed? <yes> " send "\r"; continue
expect "FORTRAN Library device? <_MS0:> " attach TS0 -erf tpc dist/fortran_iv_v2_8.tpc; send "\r"; continue
expect " Do you want to edit CONFIG.FOR (Y/N) <N>?  " send "y\r"; continue
expect "TGTDEV" send -t after=500k "\r"; continue
expect "TSKDIR" send -t after=500k "\r"; continue
expect "EDITQ" send -t after=500k "\r"; continue
expect "PURGE" send -t after=500k "\r"; continue
expect "UPDATE" send -t after=500k "YES\r"; continue
expect "LRNCH" send -t after=500k "\r"; continue
expect "LNMAX" send -t after=500k "\r"; continue
expect "CODE" send -t after=500k "\r"; continue
expect "OPTIM" send -t after=500k "\r"; continue
expect "LIBNAM" send -t after=500k "\r"; continue
expect "LIBCOD" send -t after=500k "\r"; continue
expect "MESSAG" send -t after=500k "\r"; continue
expect "BOUNDS" send -t after=500k "\r"; continue
expect "SIMRT" send -t after=500k "Y\r"; continue
expect " Do you want to edit CONFIG.FOR (Y/N) <N>?  " send "\r"; continue
expect "The RSTS/E Software Installation Procedure is complete" goto COBOL81
send -t after=250k "hello 1,3\r"
goto EOS
;
; Perform COBOL-81 v2.3 Installation
;
:COBOL81
noexpect
expect "$ " attach TS0 -er dist/cobol-81_v2_3.tap; send "mount ms0:\r"; continue
expect "$ " send "run $build\r"; continue
expect "Input device <_SY:> ? " send "ms0:\r"; continue
expect "Output device <_SY0:> ? " send "\r"; continue
expect "Control File is ? " send "c81bld\r"; continue
expect "Function (Build/Patch, Patch, Build) <Build/Patch> ? " send "\r"; continue
expect "Patch file input location <PATCH$:> ? " send "\r"; continue
Patch file input location <PATCH$:> ? " send "\r"; continue
expect "Additional Control File is <None> ? " send "\r"; continue
expect "Do you want to build the default compiler  <YES>?" send "no\r"; continue
expect "    code by default                     <CIS   >?" send "\r"; continue
expect "    the RMS resident library               <YES>?" send "\r"; continue
expect "compiler switches                          <NO >?" send "\r"; continue
expect "(NONE, CIS, NONCIS, BOTH)                 <NONE>?" send "both\r"; continue
expect ".!*** BUILD Complete ***" goto FRTRN77
goto EOS
;
; Perform FORTRAN-77 v5.4 Installation
;
:FRTRN77
noexpect
expect "$ " send "create/account autwrk$:\r"; continue
expect "$ " attach TS0 -erf tpc dist/fortran-77_v5_4.tpc; send "@autoin$:autoin\r"; continue
expect "Which product(s) do you want to install? " send "f77\r"; continue
expect "Where are the update files located <PATCH$:>? " send "\r"; continue
expect "Which device are the distribution files for F77 (F77) located on (include colon)? " send "ms0:\r"; continue
expect "Do you want to customize F77 (F77) (Y/N) <N>? " send "y\r"; continue
expect "Target device <SY:>? " send "\r"; continue
expect "Task directory <[1,2]>? " send "\r"; continue
expect "Allow future customization of this file <YES>? " send "\r"; continue
expect "Print release notes <NO>? " send "\r"; continue
expect "Print log file <NO>? " send "\r"; continue
expect "Error message type <LONG, SHORT> <LONG>? " send "\r"; continue
expect "File services <FCS,RMS,BOTH> <BOTH>? " send "\r"; continue
expect "Use alternate convert module <YES, NO> <NO>? " send "\r"; continue
expect "Build resident library <YES, NO> <NO>? " send "YES\r"; continue
expect "Build RMS clustered resident library <YES, NO> <NO>? " send "\r"; continue
expect "Build FCS resident library <YES, NO> <NO>? " send "\r"; continue
expect "Stack size (must never be less than 512 words) <1024>? " send "1536\r"; continue
expect "Compiler's dynamic storage <3840>? " send "\r"; continue
expect "Control section STACK1 (expression analyzer/common block definitions) <1160>? " send "\r"; continue
expect "DO stack (nested DO/IF statements) <240>? " send "\r"; continue
expect "Lines per page (plus 3 lines of heading) <octal value> <67>? " send "\r"; continue
expect "Printer line width <octal value> <204>? " send "\r"; continue
expect "Supersede output files <0=NO, 1=YES> <0>? " send "\r"; continue
expect "I- and D-Space support <0=NO, 1=YES> <1>? " send "\r"; continue
expect "Reinitialize switches <0=NO, 1=YES> <0>? " send "\r"; continue
expect "Array subscript bounds checking <0=NO, 1=YES> <0>? " send "\r"; continue
expect "Number of continuation lines <octal value> <23>? " send "\r"; continue
expect "Include debug lines <0=NO, 1=YES> <0>? " send "\r"; continue
expect "Default to INTEGER*4 values <0=NO, 1=YES> <0>? " send "\r"; continue
expect "Listing <1=Source, 2=(Source,Map) 3=(Source,Map,Generated code)> <2>? " send "3\r"; continue
expect "Read only code sections <0=NO, 1=YES> <0>? " send "1\r"; continue
expect "Spool listing <0=NO, 1=YES> <0>? " send "\r"; continue
expect "Trace <0=NONE, 1=NAMES, 3=BLOCKS 7=ALL> <3>? " send "7\r"; continue
expect "Number of temporary files <Range 1-3> <2>? " send "3\r"; continue
expect "Enable optional warnings <0=NO, 1=YES> <1>? " send "\r"; continue
expect "FORTRAN ANSI interpretation <0=FORTRAN-66, 1=FORTRAN-77> <1>? " send "\r"; continue
expect "Standards checking <0=NONE, 1=SOURCE, 2=SYNTAX, 3=ALL> <0>? " send "\r"; continue
expect "Produce debug information for symbolic debugger <0=NO, 1=YES> <0>? " send "\r"; continue
expect "Extend source line <0=NO (72 columns), 1=YES (132 columns)> <0>? " send "\r"; continue
expect "Code optimization <0=NO, 3=YES> <3>? " send "\r"; continue
expect "Do you want to customize F77 (F77) again (Y/N) <N>? " send "\r"; continue
expect "Installation of F77 (F77) successful." goto DIBOL_1
goto EOS
;
; Perform DIBOL v6.1-F
;
:DIBOL_1
noexpect
expect "$ " send "create/account dibol$:\r"; continue
expect "$ " send "copy patch$:dibol.com patch$:dibol.old\r"; continue
expect "$ " send "edit/edt patch$:dibol.com\r"; continue
expect "*" send "insert 109 ;$ _goto DIBOLV61 !force install from PATCH$:DBLKIT.BCK\r"; continue
expect "*" send "substitute/$/$!/ 290\r"; continue
expect "*" send "exit\r"; goto DIBOL_2
goto EOS
:DIBOL_2
noexpect
expect "$ " send "assign/sys sy:[1,2] syslib$$:\r"; continue
expect "$ " send "assign/sys sy:[1,1] lb$$:\r"; continue
expect "$ " send "@patch$:dibol DIBOL$ \"Y\" WORK$ HELP$ PATCH$: NL0:\r"; continue
expect " Do you want to continue? : " send "yes\r"; continue
expect " Do you wish to install the DMS version of Dibol? <YES> : " send "\r"; continue
expect " Do you wish to install the RMS version of Dibol? <YES> : " send "\r"; continue
expect " Do you wish DCL LINK support for the 16KW DIBOL resident library? : " send "yes\r"; continue
expect " Do you wish to run the IVP? <YES> : " send "\r"; continue
expect " Do you want to print the V6.1F release notes? <YES> : " send "\r"; continue
expect "       Installation of V6.1F of DIBOL for RSTS is complete." goto DIBOL_3
goto EOS
:DIBOL_3
noexpect
expect "$ !" continue
expect "$ !" goto DIBOL_4
goto EOS
:DIBOL_4
noexpect
expect "$ " send "copy dibol$:dibv61.com dibol$:dibv61.old\r"; continue
expect "$ " send "edit/edt dibol$:dibv61.com\r"; continue
expect "*" send "insert 1 ;$ _write 0 f$time(), \"   Starting DIBOL\"\r"; continue
expect "*" send "insert end ;$ _write 0 f$time(), \"   The DIBOL Startup Procedure is complete.\"\r"; continue
expect "*" send "exit\r"; goto BP2
goto EOS
;
; Perform BASIC-PLUS 2 Installation
;
:BP2
noexpect
expect "$ " send "@[0,1]install layered_products\r"; continue
expect "Are you ready to proceed? <yes> " send "\r"; continue
expect "Products to install: " send "bp2\r"; continue
expect "Patch account? <PATCH$:> " send "\r"; continue
expect "Is this list OK? <yes> " send "\r"; continue
expect "Target disk? <_SY:> " send "\r"; continue
expect "Are you ready to proceed? <yes> " send "\r"; continue
expect "BP2 Library device? <_MS0:> " attach TS0 -erf tpc dist/bp2_v2_7.tpc; send "\r"; continue
expect "Do you wish to install the prebuilt kit? <YES> : " send "no\r"; continue
expect "Do you want the default installation <YES>" send -t after=250k "n\r"; continue
expect "Do you want to install BP2RES <NO>" send -t after=250k "y\r"; continue
expect "Enter the device and account for BP2RES <LB:>" send -t after=250k "\r"; continue
expect "What is the absolute address for BP2RES <0>" send -t after=250k "\r"; continue
expect "Do you want to install BP2SML <NO>" send -t after=250k "y\r"; continue
expect "Enter the device and account for BP2SML <LB:>" send -t after=250k "\r"; continue
expect "What is the absolute address for BP2SML <0>" send -t after=250k "\r"; continue
expect "Do you want the compiler to use -I and -D space <NO>" send -t after=250k "y\r"; continue
expect "Do you want to install the secondary cache <NO>" send -t after=250k "y\r"; continue
expect "What size do you want to make the secondary cache <32>" send -t after=250k "\r"; continue
expect "Do you want to support RUN <YES>" send -t after=250k "\r"; continue
expect "Do you want RUN to support remote RMS file access <NO>" send -t after=250k "y\r"; continue
expect "Do you want to link the support for RUN with memory resident libraries <YES>" send -t after=250k "\r"; continue
expect "Do you want to install the BP2 Resequencer <NO>" send -t after=250k "y\r"; continue
expect "Enter the device and account for the BP2 Resequencer <SY:[1,2]>" send -t after=250k "\r"; continue
expect "Do you want to install the BP2 Optimizer <NO>" send -t after=250k "y\r"; continue
expect "Enter the device and account for the BP2 Optimizer <SY:[1,2]>" send -t after=250k "\r"; continue
expect "Do you want to install the BP2 Dump Analyzer <NO>" send -t after=250k "y\r"; continue
expect "Enter the device and account for the BP2 Dump Analayzer <SY:[1,2]>" send -t after=250k "\r"; continue
expect "Do you want to install the BP2 Help file <NO>" send -t after=250k "y\r"; continue
expect "Enter the device and account for the BP2 Help file <SY:[1,2]>" send -t after=250k "\r"; continue
expect "Do you want to install the BP2 run-time system <NO>" send -t after=250k "y\r"; continue
expect "Which hardware math package do you want to use <EIS>" send -t after=250k "fpu\r"; continue
expect "What name do you want to use to invoke BP2 <BP2>" send -t after=250k "\r"; continue
expect "What do you want to use as the BP2 compiler prompt <BASIC2>" send -t after=250k "\r"; continue
expect "Enter the device and account for the BP2 compiler <SY:[1,2]>" send -t after=250k "\r"; continue
expect "Enter the device for the BP2 compiler work files <SY:>" send -t after=250k "\r"; continue
expect "Do you want to enable data cache for the BP2 compiler work files <NO>" send -t after=250k "y\r"; continue
expect "Enter the device and account for the BP2 object module disk library <LB:>" send -t after=250k "\r"; continue
expect "Enter the device and account for the BP2 ODL files <LB:>" send -t after=250k "\r"; continue
expect "Enter the device and account for the temp installation files <SY:>" send -t after=250k "\r"; continue
expect "Enter the device and account for the RMS-11 ODL files <LB:>" send -t after=250k "\r"; continue
expect "in the range (octal 173 - 176) <NO>" send -t after=250k "\r"; continue
expect "What do you want as the default time format <SYSTEM>" send -t after=250k "\r"; continue
expect "What do you want as the default date format <SYSTEM>" send -t after=250k "\r"; continue
expect "What do you want as the character for the PRINT USING currency symbol <$>" send -t after=250k "\r"; continue
expect "What do you want as the character for the PRINT USING decimal point <.>" send -t after=250k "\r"; continue
expect "separator <,>" send -t after=250k "\r"; continue
expect "Do you want to update the BP2 compiler <NO>" send -t after=250k "y\r"; continue
expect "Enter the device and account for the update files <PATCH$:>" send -t after=250k "\r"; continue
expect "Do you want to delete the installation command files <YES>" send -t after=250k "\r"; continue
expect "Do you want to verify the installation <YES>" send -t after=250k "\r"; continue
expect "Do you wish to change any of your answers <NO>" send -t after=250k "\r"; continue
expect "The RSTS/E Software Installation Procedure is complete" goto PDP11C
goto EOS
;
; Perform PDP-11 C V1.2-006 Installation
;
:PDP11C
noexpect
expect "$ " send "create/account autwrk$:\r"; continue
expect "$ " attach TS0 -erf tpc dist/c_v1_2.tpc; send "@autoin$:autoin\r"; continue
expect "Which product(s) do you want to install? " send "ccc\r"; continue
expect "Where are the update files located <PATCH$:>? " send "\r"; continue
expect "Which device are the distribution files for CCC (CCC) located on (include colon)? " send "ms0:\r"; continue
expect "Do you want to customize CCC (CCC) (Y/N) <N>? " send "y\r"; continue
expect "Suppress use of I/D space feature even if present <NO>? " send "\r"; continue
expect "Print release notes <NO>? " send "\r"; continue
expect "Print log file <NO>? " send "\r"; continue
expect "Do you want to customize CCC (CCC) again (Y/N) <N>?  " send "\r"; continue
expect "Installation of CCC (CCC) successful." goto FMS11
goto EOS
;
; Perform FMS-11/RSTS V2.1 Installation
;
:FMS11
noexpect
expect "$ " send "@[0,1]install layered_products\r"; continue
expect "Are you ready to proceed? <yes> " send "\r"; continue
expect "Products to install: " send "fms\r"; continue
expect "Patch account? <PATCH$:> " send "\r"; continue
expect "Is this list OK? <yes> " send "\r"; continue
expect "Target disk? <_SY:> " send "\r"; continue
expect "Are you ready to proceed? <yes> " send "\r"; continue
expect "FMS Library device? <_MS0:> " attach TS0 -erf tpc dist/fms11_v2_1.tpc; send "\r"; continue
expect "Build FDV resident library without debug mode? <yes> : " send "\r"; continue
expect "Build FDV resident library with debug mode? <yes> : " send "\r"; continue
expect "Build FMS demonstration program for FORTRAN-77? <yes> : " send "\r"; continue
expect "Build FMS demonstration program for BASIC-PLUS-2? <yes> : " send "\r"; continue
expect "Build FMS demonstration program for COBOL-81? <yes> : " send "\r"; continue
expect "Build FMS demonstration program for DIBOL? <yes> : " send "\r"; continue
expect "The RSTS/E Software Installation Procedure is complete" goto CONFIG3A
goto EOS
;
; Relocate and/or Create Layered Product initialization scripts, add them to START.COM
;
:CONFIG3A
noexpect
expect "$ " send "copy/protection=40 unsupp$:b2cref.hlp lb:b2cref.hlp\r"; continue
expect "$ " send "copy bp2ins.cmd bp2$:bp2ins.old\r"; continue
expect "$ " send "rename cc$:pdp11c.ins cc$:pdp11c.old\r"; continue
expect "$ " send "rename fms$:fmstrt.com fms$:fmstrt.old\r"; continue
expect "$ " send "delete bp2ins.cmd\r"; continue
expect "$ " attach ts0 -rf ansi-rsts dist/cmd/*.txt; send "mount/override=id ms0:\r"; continue
expect "$ " send "copy ms0:bp2ins.txt bp2$:bp2ins.cmd\r"; continue
expect "$ " send "copy ms0:f77ins.txt frtrn7$:f77ins.cmd\r"; continue
expect "$ " send "copy ms0:fmstrt.txt fms$:fmstrt.com\r"; continue
expect "$ " send "copy ms0:pdp11c.txt cc$:pdp11c.ins\r"; continue
expect "$ " send "copy ms0:tkuser.txt [1,3]tkuser.com\r"; continue
expect "$ " send "dismount/unload ms0:\r"; continue
expect "$ " send "copy [0,1]start.com [1,3]start.com\r"; continue
expect "$ " send "edit [1,3]start.com\r"; goto CONFIG3B
goto EOS
:CONFIG3B
noexpect
expect "*" send "insert 88 ;assign/system         _SY:[0,100] EMS$:\r"; continue
expect "*" send "insert 151 ; install/runtime_system UNSUPP$:FORTH\r"; continue
expect "*" send "insert 201 ; define/command/system B1C-REF    UNSUPP$:B2CREF.TSK /line_number=CCL\r"; continue
expect "*" send "insert 201 ; define/command/system B2C-REF    UNSUPP$:B2CREF.TSK /line_number=CCL\r"; continue
expect "*" send "insert 201 ; define/command/system BLD-ODL    $C81ODL.TSK\r"; continue
expect "*" send "insert 202 ; define/command/system C81-       $C81.TSK\r"; continue
expect "*" send "insert 204 ; define/command/system DISP-LAY   AUXLIB$:DISPLY.TSK\r"; continue
expect "*" send "insert 209 ; define/command/system GRIPE-     AUXLIB$:GRIPE.TSK\r"; continue
expect "*" send "insert 216 ; define/command/system MEM-ORY    UNSUPP$:MEMORY.TSK\r"; continue
expect "*" send "insert 217 ; define/command/system ODT-       AUXLIB$:ODT.TSK\r"; continue
expect "*" send "insert 219 ; define/command/system QUO-TA     AUXLIB$:QUOLST.TSK\r"; continue
expect "*" send "insert 219 ; define/command/system RFM-T      $C81RFM.TSK\r"; continue
expect "*" send "insert 219 ; define/command/system RNO-       AUXLIB$:RUNOFF.TSK\r"; continue
expect "*" send "insert 220 ; define/command/system STAT-US    UNSUPP$:STATUS.TSK\r"; continue
expect "*" send "insert 262 ;$ _set printer LP0:/device_type=LP11/lowercase\r"; continue
expect "*" send "replace 200 ; define/command/system BPC-REF    AUXLIB$:BPCREF.TSK /line_number=CCL\r"; continue
expect "*" send "replace 203 ; define/command/system DIR-ECTORY $DIRECT.TSK        /line_number=CCL/privilege\r"; continue
expect "*" send "replace 208 ; define/command/system FIT-       AUXLIB$:FITREF.TSK /line_number=CCL\r"; continue
expect "*" send "replace 215 ; define/command/system MAK-E      TECO$:TECO.TEC     /line_number=3584\r"; continue
expect "*" send "replace 216 ; define/command/system MU-NG      TECO$:TECO.TEC     /line_number=3584\r"; continue
expect "*" send "replace 222 ; define/command/system TE-CO      TECO$:TECO.TEC     /line_number=3584\r"; continue
expect "*" send "replace 224 ; define/command/system HFT-       $HFT.TSK\r"; continue
expect "*" send "replace 225 ; define/command/system STK-       $STK.TSK\r"; continue
expect "*" send -t delay=100k "replace 181 thru 182\r set terminal kba0:/permanent/device_type=LA36\r set terminal kba1:/permanent/device_type=LA36\r    ! System consoles as hard copy\r\032"; continue
expect "*" send -t delay=100k "replace 183 thru 184\r set terminal kbd0:/permanent/device_type=LA100\r set terminal kbd1:/permanent/device_type=LA100\r set terminal kbd2:/permanent/device_type=LA100\r set terminal kbd3:/permanent/device_type=LA100\r    ! Pseudo-keyboards 0 thru 3 for batch\r\032"; continue
expect "*" send -t delay=100k "delete 185 thru 186\r"; continue
expect "*" send -t delay=100k "replace 187 thru 188\r set terminal kbg0:/permanent/dialup/answerback/noautobaud\r set terminal kbg1:/permanent/dialup/answerback/noautobaud\r set terminal kbg2:/permanent/dialup/answerback/noautobaud\r set terminal kbg3:/permanent/dialup/answerback/noautobaud\r set terminal kbg4:/permanent/dialup/answerback/noautobaud\r set terminal kbg5:/permanent/dialup/answerback/noautobaud\r set terminal kbg6:/permanent/dialup/answerback/noautobaud\r set terminal kbg7:/permanent/dialup/answerback/noautobaud\r    ! DZ11 #1 lines 0 thru 7 as dial-up\r\032"; continue
expect "*" send -t delay=100k "replace 189 thru 190\r set terminal kbg8:/permanent/dialup/answerback/noautobaud\r set terminal kbg9:/permanent/dialup/answerback/noautobaud\r set terminal kbg10:/permanent/dialup/answerback/noautobaud\r set terminal kbg11:/permanent/dialup/answerback/noautobaud\r set terminal kbg12:/permanent/dialup/answerback/noautobaud\r set terminal kbg13:/permanent/dialup/answerback/noautobaud\r set terminal kbg14:/permanent/dialup/answerback/noautobaud\r set terminal kbg15:/permanent/dialup/answerback/noautobaud\r    ! DZ11 #2 lines 0 thru 7 as dial-up\r\032"; continue
expect "*" send -t delay=100k "replace 230\r$ !   examples:\r$ !   $ _copy SY:[1,2]SYSTAT.TSK DV0:[0,1]/PROTECTION=232/CLUS=-1\r$ _copy SY:[1,2]MACRO.SAV DV0:[0,1]/PROTECTION=104/CLUS=-1\r$ _copy SY:[1,2]LINk.SAV DV0:[0,1]/PROTECTION=104/CLUS=-1\r\032"; continue
expect "*" send -t delay=100k "replace 234 thru 235\r$ !   examples:\r$ !   $ _delete/command/system SYSTAT\r$ !   $ _define/command/system SY-STAT DV0:[0,1]SYSTAT.* /PRIV/LINE_NUMBER=CCL\r$ _delete/command/system MACRO\r$ _delete/command/system MAC\r$ _delete/command/system LINK\r$ _define/command/system MACR-O DV0:[0,1]MACRO.SAV /LINE_NUMBER=8216\r$ _define/command/system MAC- $MAC.TSK\r$ _define/command/system LIN-K DV0:[0,1]LINK.SAV /LINE_NUMBER=8208\r\032"; continue
expect "*" send -t delay=100k "insert 323\r$ ! *** Initialize layered products ***\r$ !\r$! _write 0 f$time()+ \"   Initializing layered products\"\r$ _if f$search(\"BP2$:BP2INS.CMD\") .nes. \"\" then @BP2$:BP2INS.CMD\r$ _if f$search(\"FRTRN7$:F77INS.CMD\") .nes. \"\" then @FRTRN7$:F77INS.CMD\r$ _if f$search(\"DIBOL$:DIBV61.COM\") .nes. \"\" then @DIBOL$:DIBV61.COM\r$ _if f$search(\"PDP11C.INS\") .nes. \"\" then @PDP11C.INS\r$ _if f$search(\"FMS$:FMSTRT.COM\") .nes. \"\" then @FMS$:FMSTRT.COM\r$ _if f$search(\"MAIL$:MAILIN.COM\") .nes. \"\" then @MAIL$:MAILIN.COM\r$ _if f$search(\"EMS$:EMS.COM\") .nes. \"\" then submit EMS$:EMS.COM\r\r\032"; continue
expect "*" send "exit\r"; goto CONFIG3C
goto EOS
:CONFIG3C
noexpect
expect "$ " send "copy unsupp$:ems.com ems.com\r"; continue
expect "$ " send "edit [1,3]ems.com\r"; goto CONFIG3D
goto EOS
:CONFIG3D
noexpect
expect "*" send "replace 79 ;$ F_NAME=F$SEARCH(\"EMS$:*.*\")\r"; continue
expect "*" send "replace 80 ;$ _IF F_NAME .EQS. EMS_COM THEN _GOTO BACK_LATER\r"; continue
expect "*" send "replace 81 ;$ _IF F_NAME .EQS. "" THEN _GOTO FATAL\r"; continue
expect "*" send "exit\r"; goto CONFIG3E
goto EOS
:CONFIG3E
noexpect
expect "$ " send "copy [1,3]start.com dm0:[0,1]start.com\r"; continue
expect "OK to replace existing file DM0:[0,1]START .COM ? " send "yes\r"; goto CONFIG3F
goto EOS
:CONFIG3F
noexpect
expect "$ " send "copy [1,3]ems.com dm0:[0,9]ems.com\r"; continue
expect "OK to replace existing file DM0:[0,9]EMS   .COM ? " send "yes\r"; goto CONFIG3G
goto EOS
:CONFIG3G
noexpect
expect "$ " send "create/account/template=[0,82] [0,100]\r"; continue
expect "$ " send "run $shutup\r"; continue
expect "Allow Print/Batch Services jobs to complete <YES>?  " send "yes\r"; continue
expect "Minutes until system shutdown (0-99) <5>?  " send "0\r"; continue
expect "Shutdown with automatic RESTART <NO>?  " send "yes\r"; continue
expect "Proceed with system startup? <YES> " send "\r"; continue
expect "RSTS/E is on the air..." goto POSTINSTALL
goto EOS
;
; 
;
:POSTINSTALL
noexpect
expect "$ " send "copy unsupp$:ems.com ems$:ems.com\r"; continue
expect "$ " attach ts0 -rf ansi-rsts users.txt; send "mount/override=id ms0:\r"; continue
expect "$ " send "copy ms0:users.txt [1,3]users.dat\r"; continue
expect "$ " send "dismount/unload ms0:\r"; continue
expect "$ " send "@tkuser \"%NAME%\" %EMAIL% %ADMPWD%\r"; continue
expect "$ " send "run mail$:names\r"; continue
expect "Input ASCII account file <MAIL$:NAMES.DAT> " send "[1,3]names.dat\r"; continue
expect "Output BINARY username file <MAIL$:NAMES.SYS> " send "\r"; continue
expect "$ " send "ncp\r"; continue
expect "NCP>" send "define node %AREA%.%CENTRALNODE% name %CENTRALNAME%\r"; continue
expect "NCP>" send "exit\r"; continue
expect "$ " send "run $shutup\r"; continue
expect "Allow Print/Batch Services jobs to complete <YES>?  " send "yes\r"; continue
expect "Minutes until system shutdown (0-99) <5>?  " send "0\r"; continue
expect "Shutdown with automatic RESTART <NO>?  " send "no\r"; continue
expect "Start timesharing? <Yes> " send "no\r"; continue
expect "Option: <Start> " goto STOP
send -t after=250k "hello 1,3\r"
goto EOS
;
; End of Script
;
:EOS
continue
:STOP
echo  
echo ************************************************************************
echo * Turnkey RSTS/E 10.1-L system installation complete.                  *
echo ************************************************************************
set CONSOLE NOLOG
:END
