' CHINESE CHECKERS  DOS / WINDOWS Installation Script
' Copyright 1994, ImagiSOFT, Inc.
' Version 2.3
' April 1, 1995

' Note:  This installation script is written for THE FINISHING TOUCH, a
'        professional installation program which is also an ImagiSOFT
'        product.  It is distributed with CHINESE CHECKERS to make
'        installation easier, and to reduce our support calls.

'        This does not unpack compressed files (*.PAK) which is a
'        major feature of the program.  For more information about
'        THE FINISHING TOUCH, call ImagiSOFT at (505) 275-1920, or call
'        our personal BBS number with your modem at (505) 275-9696.
'        It will always have the latest shareware version of
'        THE FINISHING TOUCH so you can "try before you buy".

BACKGROUND ~0\INSTALL.BIN
TELESCOPE OFF

LANGUAGE ENGLISH      ' supports GERMAN, FRENCH, SPANISH, DANISH, and DUTCH

BORDER 1
TELESCOPE ON
SHADOW OFF

PAUSE 300             ' display screen for 3 seconds

CALL NO_VGA           ' test for vga+ monitor


' display opening menu
:OPENING

WINOPEN 0 4 31
"        INSTALLATION OPTIONS MENU"
""
"1.  Install as Microsoft Windows 3.1 Application"
"2.  Install as DOS Application"
"3.  QUIT"
""
"SELECT ONE OF THE ABOVE:    "

WINUPDATE +10 +1 30
"INSTALLATION OPTIONS MENU"
INPUT A 1 +28 +7 15
WINCLOSE

CALL TEMP_FILE

EXIST ~3\1.TMP
JUMP.YES WINDOWS_APP

EXIST ~3\2.TMP
JUMP.YES DOS_APP

EXIST ~3\3.TMP
JUMP.YES EXIT

BEEP
CALL TMP_DEL
JUMP OPENING

' ------------------------
'   install as a dos app
' ------------------------
:DOS_APP
CALL TMP_DEL

' have user set the drive
CALL ESC
DRIVE C 0 12 31 15 32 14 79
WINCLOSE

' have user set the path
CALL ESC
PATH \CHINESE 0 12 31 15 32 14 79
WINCLOSE

CALL EMPTY_DIR
CALL UNPACK

' create color wizard batch file
PROMPT OFF
DELETE ~1\CHINESE.BAT 0 0 0
PROMPT ON
FILE ~1\CHINESE.BAT
"~1"
"cd ~2"
"CHINESE"
"cd \"

WINOPEN 0 4 31
"CHINESE CHECKERS has been successfully installed."
""
"     To run it, enter the command"
"     from the root directory of drive ~1."
""
""
""
""
"Press the [Enter] key to continue."
WINUPDATE +36 +3 30
"CHINESE"
WINUPDATE +7 +6 27
"THANK YOU FOR CHOOSING OUR SOFTWARE!"
WAIT +36 +9
WINCLOSE

:RUN
WINOPEN 0 10 31
"Would you like to run CHINESE CHECKERS right now   Y or N?"
ASK +60 +1
JUMP.NO EXIT
RUN ~1\CHINESE.BAT

' --------------------------
'   install as windows app
' --------------------------
:WINDOWS_APP

' these commands set drive and path variables
DRIVE C
PATH \WINDOWS

:TEST_WIN
EXIST ~1~2\WIN.COM
JUMP.YES WIN_INSTALL

EXIST ~3\1.TMP
JUMP.YES SKIP_BEEP
BEEP
RD ~1~2
WINOPEN 0 4 79
"Microsoft Windows is NOT found in the"
"~1~2 directory.  Please try again."
""
"Press ENTER to continue."
WAIT +26 +4
WINCLOSE

' windows is in a directory other than C:\WINDOWS
:SKIP_BEEP
CALL TMP_DEL
WINOPEN 0 4 31
"To install CHINESE CHECKERS to Microsoft Windows,"
"we need to know which hard drive Windows is installed on."
""
"             Most people have Windows on this hard drive."
"             Press ENTER if this is correct, or change to"
"             the correct drive letter."
"             (Press ESC to quit.)"
PROMPT OFF
DRIVE C +2 +3 17 14 32 14 79
WINCLOSE

PROMPT ON
WINOPEN 0 4 31
"We also need to know the name of the directory where Microsoft"
"Windows is installed.  Most people have Windows installed in"
"                              this directory.  Press ENTER"
"                              if this is OK, or input the name"
"                              of the directory where Windows"
"                              is installed."
"                              (Press ESC to quit.)"
PROMPT OFF
PATH \WINDOWS +1 +3 17 14 32 14 79
WINCLOSE
PROMPT ON
PROMPT OFF
JUMP TEST_WIN

' you know the windows directory, now install it
:WIN_INSTALL
CALL TMP_DEL

PROMPT OFF
COPY ~1~2\PROGMAN.INI ~1~2\PROGMAN.BAK 0 0 0
PROMPT ON
FILE ~1~2\PROGMAN.INI
"Group501=~1\CHINESE\CHINESE.GRP"

PATH \CHINESE
MD ~1~2

CALL EMPTY_DIR

CALL UNPACK


' --------------------------------
'  successful install to windows
' --------------------------------
WINOPEN 0 4 31
"CHINESE CHECKERS has been installed in your Windows environment"
"in the ~1~2 directory.  However, these changes won't"
"take effect until you exit Windows, then run Windows again."
""
""
""
"Press ENTER to return to Windows."
WINUPDATE +12 +5 27
"THANK YOU FOR CHOOSING OUR SOFTWARE!"
WAIT +35 +7
WINCLOSE
END

' ------------------
'   error messages
' ------------------
:INSTALL_FAILURE
BEEP
WINOPEN 0 4 79
"CHINESE CHECKERS INSTALLATION FAILED BEFORE IT FINISHED!!"
""
"Possible reasons:"
"   -- The floppy disk was damaged during shipping."
"   -- Your disk drive is out of alignment."
""
"You may want to delete the files in the ~1~2 directory."
""
"      Press [Enter] to Quit."
WAIT +30 +9
WINCLOSE
JUMP EXIT

' -----------
' subroutines
' -----------
:EMPTY_DIR
EXIST ~1~2\*.*                 ' brand new directory
JUMP.NO SKIP_DEL

EXIST ~1~2\CHINESE.EXE          ' existing chinese checkers software
JUMP.YES SKIP_DEL

WINOPEN 0 4 79
"The directory ~1~2 already exists and contains files!"
""
"   You will have to DELETE ALL THE FILES in this"
"   directory prior to installing in here."
""
"Press ENTER to Continue."
WAIT +25 +6
WINCLOSE
JUMP OPENING

:SKIP_DEL
RETURN

' unpack data files
:UNPACK

PROMPT OFF
COPY ~3\CONFIG.SYS ~3\CONFIG.BAK 0 0 0
PROMPT ON
SET.FILES 16

WINOPEN 0 20 47
" Look for fun, "hidden" features by clicking your mouse in odd places. "

FILE ~1~2\TEST_DIR.XY$
"testing whether user is trying to install to same directory."
EXIST ~0\TEST_DIR.XY$
JUMP.YES UNPACK_BACK

COPY ~0\C*.* ~1~2\ 0 12 31
JUMP.FAIL INSTALL_FAILURE

COPY ~0\*.TXT ~1~2\ 0 12 31
JUMP.FAIL INSTALL_FAILURE

WINCLOSE

:UNPACK_BACK
PROMPT OFF
DELETE ~1~2\TEST_DIR.XY$ 0 0 0
PROMPT ON

RETURN

' create a temporary file in the default directory with a unique name based on the number input by the user
:TEMP_FILE
FILE ~3\~A.TMP
"Delete this temporary file."
RETURN

' delete temporary file created by opening menu
:TMP_DEL
PROMPT OFF
DELETE ~3\~A.TMP 0 0 0
PROMPT ON
RETURN

:ESC
WINOPEN 0 20 31
"(Press ESC to Quit) "
RETURN

:NO_VGA
VIDEO VGA              ' vga monitor is required
JUMP.YES SKIP_VGA
WINOPEN 0 4 79
"This software requires a VGA monitor to run."
"It probably won't run on your computer.  Do"
"you want to install it anyway        Y or N?"
ASK +39 +3
JUMP.YES SKIP_VGA
JUMP EXIT
:SKIP_VGA
RETURN

:EXIT
CALL TMP_DEL
END
