' Install script for MAPIT,  Copyright 1992, 1993 John B. Allison
BACKGROUND 63    ' display cyan colored background (see color chart in docs)
LANGUAGE ENGLISH
BORDER 1                                   ' single line borders. 2 = double, 0 = no border
TELESCOPE ON
SHADOW ON

WINOPEN 0 2 30
"                 MAPIT Installation               "      ' yellow text

WINOPEN 0 0 31
"Shareware MAPIT requires 1 MB of space on your hard drive."      
""
"Where should this data be stored?"

WINUPDATE +12 +1 30
"MAPIT"                            ' yellow text

PAUSE 200
SPACE 1000                         ' 1 MB initial disk requirements.

'  Prompt for the drive to install to:

DRIVE C 0 21 31 15 0 14 79
PATH \MAPIT 0 21 31 15 0 14 79

WINCLOSE

' --------------------------------------------------------------------------
'  Get load options from user.

EXIST ~1~2\DEMO.MP3          
JUMP.NO LOAD_DATA1

WINOPEN 0 0 31
"MAPIT data already exists on ~1~2."
""
"Do you want to overwrite it?"
""
""
WINUPDATE +14 +5 27            ' magenta text
"(Y or N)"

ASK +22 +5
WINCLOSE
JUMP.YES LOAD_DATA1
JUMP EARLY_OUT


' --------------------------------------------------------------------------
'  Load data from distribution disks.
:LOAD_DATA1

COPY ~0\README.DOC ~1~2\*.* 0 0 31      ' Copy from first disk.
COPY ~0\*.PCX ~1~2\*.* 0 0 31

EXIST ~0\MAPITA.PAK           ' Should never fail.  Just read from drive.
JUMP.YES BASEDATA1

WINOPEN 0 0 31
"Insert MAPIT Disk 2 into drive ~0."
""
"Enter Y to continue."

WINUPDATE +8 +3 30           ' yellow text
"Y"

ASK +25 +3                    ' one method of providing a "conditional" jump
WINCLOSE
JUMP.YES LOAD_DATA1
JUMP EARLY_OUT

:BASEDATA1
UNPACK MAPITA.PAK 0 0 31 32 19 79
JUMP.FAIL INSTALL_FAILURE

' --------------------------------------------------------------------------
'  Load second half from same or another disk.
:LOAD_DATA2

EXIST ~0\MAPITB.PAK           ' Should never fail.  Just read from drive.
JUMP.YES BASEDATA2

WINOPEN 0 0 31
"Insert the Final MAPIT Disk into drive ~0."
""
"Enter Y to continue."

WINUPDATE +8 +3 30           ' yellow text
"Y"

ASK +25 +3                    ' one method of providing a "conditional" jump
WINCLOSE
JUMP.YES LOAD_DATA2            
JUMP EARLY_OUT

:BASEDATA2
UNPACK MAPITB.PAK 0 0 31 32 19 79
JUMP.FAIL INSTALL_FAILURE

'--------------------------------------------------------------------------
' Concatinate .mp3 files.

SHELL
"COPY /B ~1~2\DEMO.MP3+~1~2\DEMOB.MP3 ~1~2\DEMO.MP3"
"DEL ~1~2\DEMOB.MP3"

' -----------------------
' View the documentation?
' -----------------------
:VIEW_INSTALL.TXT
WINOPEN 0 0 31
"README.DOC will be left in the directory ~1~2"
""
"Would you like to view README.DOC on-line now?"
""
""

WINUPDATE +20 +5 27            ' magenta text
"(Y or N)"

ASK +28 +5                     
WINCLOSE                       
JUMP.NO PRINT_INSTALL.TXT      ' again, skip the view command if the user
                               ' hits the "N" key from the above ASK statement.

WINOPEN 0 0 31                ' large file takes a while from floppy ...
"Loading..."
VIEW ~1~2\README.DOC 113 31
WINCLOSE                      ' close the above window

' ------------------------
' Print the documentation?
' ------------------------
:PRINT_INSTALL.TXT
WINOPEN 0 0 31
"Would you like to print README.DOC?"
""
""
WINUPDATE +15 +3 27           ' magenta text
"(Y or N)"

ASK +23 +3                    ' one method of providing a "conditional" jump

WINCLOSE                      ' close the above window
JUMP.NO VIEW_REGISTRATION

WINOPEN 0 0 31                ' printing large file takes a while ...
""
"  Printing...  "
""
PRINT ~1~2\README.DOC
WINCLOSE                      ' close the above window
JUMP.FAIL PRINTER_ERROR       ' jump on fatal error
JUMP VIEW_REGISTRATION        ' print successful, skip next

:PRINTER_ERROR                ' label for error condition
WINOPEN 0 0 79                ' open the following window
"Your printer is not responding.  Possible problems:"
"   -- Printer is not turned on"
"   -- Printer is out of paper"
"   -- Printer is not attached to LPT1 (parallel port 1)"
""
"Do you want to try to print again  (Y or N)?"
ASK 57 18                     ' prompt for Y or N key  (fixed cursor position)
WINCLOSE                      ' close this window
JUMP.YES PRINT_INSTALL.TXT    ' y key pressed, print

' ----------------------
' View the registration?
' ----------------------
:VIEW_REGISTRATION
WINOPEN 0 0 31
"REGISTER.DOC will be left in the directory ~1~2"
""
"MAPIT comes with much more detailed data.  Examine your options"
"and register today."
""
"Would you like to view REGISTER.DOC on-line now?"
""
""
WINUPDATE +2 +3 30
"MAPIT"                        ' yellow text
WINUPDATE +28 +8 27            ' magenta text
"(Y or N)"

ASK +36 +8                     
WINCLOSE                       
JUMP.NO PRINT_INSTALL_1       ' again, skip the view command if the user

WINOPEN 0 0 31                ' large file takes a while from floppy ...
"Loading..."
VIEW ~1~2\REGISTER.DOC 113 31
WINCLOSE                      ' close the above window

' ------------------------
' Print the registration?
' ------------------------
:PRINT_INSTALL_1
WINOPEN 0 0 31
"Would you like to print REGISTER.DOC?"
""
""
WINUPDATE +15 +3 27           ' magenta text
"(Y or N)"

ASK +23 +3                    ' one method of providing a "conditional" jump

WINCLOSE                      ' close the above window
JUMP.NO CHECK_HARDWARE

WINOPEN 0 0 31                ' printing large file takes a while ...
""
"  Printing...  "
""
PRINT ~1~2\REGISTER.DOC
WINCLOSE                      ' close the above window
JUMP.FAIL PRINTER_ERROR_1     ' jump on fatal error
JUMP CHECK_HARDWARE           ' print successful, skip next

:PRINTER_ERROR_1              ' label for error condition
WINOPEN 0 0 79                ' open the following window
"Your printer is not responding.  Possible problems:"
"   -- Printer is not turned on"
"   -- Printer is out of paper"
"   -- Printer is not attached to LPT1 (parallel port 1)"
""
"Do you want to try to print again  (Y or N)?"
ASK 57 18                     ' prompt for Y or N key  (fixed cursor position)
WINCLOSE                      ' close this window
JUMP.YES PRINT_INSTALL_1      ' y key pressed, print

'--------------
:CHECK_HARDWARE
'--------------
VIDEO EGA
JUMP.YES CK_MOUSE

WINOPEN 0, 0, 31
"MAPIT requires a graphics display."
""
"An EGA or better is recommended."
""

WINUPDATE +2 +1 30            ' yellow text
"MAPIT"

WAIT 2 4

:CK_MOUSE
MOUSE 0.0
JUMP.YES EXIT

WINOPEN 0, 0, 31
"MAPIT requires a MOUSE."
""
"This system has no mouse enabled."
""
"You must install one before running MAPIT."
""

WINUPDATE +2 +1 30            ' yellow text
"MAPIT"
WINUPDATE +37 +5 30           ' yellow text
"MAPIT"

WAIT 2 6
JUMP FINI

' ----------------------
' display closing window
' ----------------------
:EXIT
WINOPEN 0 0 31
"MAPIT installation is complete."
""
"Would you like to run MAPIT now?"
""
""

WINUPDATE +2 +1 30            ' yellow text
"MAPIT"
WINUPDATE +24 +3 30            ' yellow text
"MAPIT"

WINUPDATE +15 +5 27            ' magenta text
"(Y or N)"

ASK +23 +5
WINCLOSE
JUMP.NO FINI

:GO_DEMO
WINOPEN 0 0 31
"Copying COLUMBUS.MP3 to EXTENDED.MP3 and"
""
"running MAPIT."
WINUPDATE +10 +3 30            ' yellow text
"MAPIT"

PAUSE 500

PROMPT OFF      ' Turn off copy prompts.
COPY ~1~2\COLUMBUS.MP3 ~1~2\EXTENDED.MP3 0 0 31

'RUN ~1~2\MAPITDEM                   ' Never to return.
RUN ~1~2\MAPIT                   ' Never to return.

' ------------------------
' exit the system normally
' ------------------------
:EARLY_OUT

:FINI
END

:INSTALL_FAILURE
WINOPEN 0 0 79
"THE INSTALLATION PROGRAM FAILED PRIOR TO COMPLETION"
""
"Possible reasons:"
"   -- The floppy disk was removed prior to completion."
"   -- The floppy disk was damaged during shipping."
"   -- Your disk drive is out of alignment."
""
"      Press [Enter] to Quit."
WAIT 47 15
JUMP EARLY_OUT
