From:	CSBVAX::MRGATE!@KL.SRI.Com:BOB%HOWARD@cc.utah.edu@SMTP 13-SEP-1987 06:33
To:	EVERHART
Subj:	checksum/verify program (2 of 4)

Received: from CC.UTAH.EDU by KL.SRI.COM with TCP; Sun 13 Sep 87 02:35:06-PDT
Date: Sun, 13 Sep 87 03:37 MST
From: BOB%HOWARD@cc.utah.edu
Subject: checksum/verify program (2 of 4)
To: info-vax@KL.SRI.COM
X-VMS-To: INFOVAX

$Part3:
$ File_is="KITINSTAL.COM"
$ Check_Sum_is=1362976760
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X$! Module:      CHECKSUM/VERIFY Installation Procedure for VMSINSTAL
X$!
X$! Author:      Bob Wheeler
X$!              Howard Hughes Medical Institute at Salt Lake City
X$
X$
X$       if f$ext(0,5,p1) .eqs. "HELP_" then goto 'p1
X$       if p1 .eqs. "VMI$_INSTALL" then goto install
X$       if p1 .eqs. "VMI$_IVP" then goto ivp
X$       exit vmi$_unsupported
X$
X$
X$  install:
X$       on control_y then vmi$callback control_y
X$       on warning then goto failed
X$
X$       say := write sys$output
X$
X$       p$required = 1
X$
X$
X$!------------------------------------------------------------------------------
X$!
X$!  GET PARAMETERS  -  Read in symbols and values from KITDATA.DAT and equate
X$!                     them.
X$!
X$!------------------------------------------------------------------------------
X$
X$       open/read/error=kitdata_error k$kitdata vmi$kwd:kitdata.dat
X$
X$       k$line = 0
X$
X$  next_symbol:
X$
X$       k$rec = ""
X$
X$  read_loop_1:
X$
X$       read/end=kitdata_eof k$kitdata k$string
X$       k$line = k$line + 1
X$       k$string = f$edit(k$string,"UNCOMMENT,COMPRESS,TRIM")
X$
X$       k$rec = k$rec + k$string
X$       if k$rec .eqs. "" then goto read_loop_1
X$       if f$extract(f$length(k$rec) - 1,1,k$rec) -
X        .nes. "-" then goto assign_value
X$
X$       k$rec == f$extract(0,f$length(k$rec) - 1,k$rec)
X$       goto read_loop_1
X$
X$
X$  assign_value:
X$
X$       if f$extract(0,1,k$rec) .eqs. "." then goto check_vms
X$
X$       param = f$edit(f$element(0," ",k$rec),"TRIM")
X$       value = f$edit(f$element(1," ",k$rec),"TRIM")
X$
X$       if param .eqs. "" .or. value .eqs. "" then goto bad_sym_syntax
X$
X$       'param = 'value
X$       
X$       goto next_symbol
X$
X$
X$  bad_sym_syntax:
X$
X$       vmi$callback MESSAGE s BADPARAM -
X        "Invalid parameter assignment in KITDATA.DAT line ''k$line "
X$       say "    ''k$rec "
X$
X$       goto failed
X$
X$
X$  kitdata_error:
X$
X$       vmi$callback MESSAGE s nokitdata "KITDATA.DAT file not found"
X$       exit vmi$_failure
X$
X$
X$
X$!------------------------------------------------------------------------------
X$!
X$!  CHECK VMS  -  Make sure that we are running the correct version of VMS
X$!
X$!------------------------------------------------------------------------------
X$
X$  check_vms:
X$
X$
X$       if f$type(p$vms_version) .nes. "" then goto version_known
X$
X$       vmi$callback MESSAGE s NOVERSION -
X    "Minimum version of VMS not supplied in symbol p$vms_version"
X$
X$       goto failed
X$
X$
X$  version_known:
X$
X$       say "" 
X$       if f$elem(0,",",vmi$vms_version) .nes. "RELEASED" then goto check_alt
X$       if f$elem(1,",",vmi$vms_version) .ges. p$vms_version then goto check_alt
X$       k$pretty = f$str(f$int(f$ext(0,2,p$vms_version))) + "." + -
X                 f$ext(2,1,p$vms_version)
X$       vmi$callback MESSAGE e badvms -
X                "''p$name requires VMS V''k$pretty or a later version."
X$       goto failed
X$
X$
X$
X$!------------------------------------------------------------------------------
X$!
X$!  GET DIRECTORY - Figure out where the party is going to be
X$!
X$!------------------------------------------------------------------------------
X$
X$  check_alt:
X$
X$!      We don't want to deal with the problems of alternate roots.
X$
X$       if .not. vmi$alternate_root then goto get_dir
X$       vmi$callback MESSAGE e noaltroot -
X            "''p$name cannot be installed in an alternate system root."
X$       goto failed
X$
X$
X$  get_dir:
X$
X$!      Determine the directory in which the product is to be placed and create
X$!      the directory.
X$
X$       if f$type(p$standard_directory) .nes. "" then goto dir_known
X$
X$       vmi$callback MESSAGE s NODEFDIR -
X    "Default product directory not found in symbol p$standard_directory"
X$       goto failed
X$
X$
X$  dir_known:
X$
X$       vmi$callback ASK k$product_dir -
X                "In which directory is ''p$name to be installed" -
X                'p$standard_directory sd "@vmi$kwd:kitinstal HELP_NEW_DIR"
X$
X$       k$dir = f$parse(k$product_dir,,,"DEVICE","SYNTAX_ONLY") - 
X                + f$parse(k$product_dir,,,"DIRECTORY","SYNTAX_ONLY")
X$
X$       vmi$callback ASK k$ -
X                "Is directory ''k$dir correct" "YES" b
X$       if .not. k$ then goto get_dir
X$
X$       k$product_dir = k$dir
X$
X$
X$!------------------------------------------------------------------------------
X$!
X$!  GET SOURCES -  See if there are sources and if the user wants them
X$!
X$!------------------------------------------------------------------------------
X$
X$  get_sources:
X$
X$       vmi$callback ASK p$sources -
X          "Do you want the VAX C sources for CHECKSUM/VERIFY installed" -
X          "YES" bd
X$
X$
X$       if .not.p$sources then goto do_help
X$
X$       p$peak_utilization = p$peak_utilization + p$source_size
X$       p$net_utilization = p$net_utilization + p$source_size
X$
X$
