@ECHO OFF
REM:This batch file and TBW.exe are (C)1990-Steve Shubitz-All rights reserved
REM:ToolBook developers may license this install for a reasonable fee
REM:Please call (619) 546-9309 for a quote
REM:Version 1.2 for ONE 5.25 DISK install
break on
verify on
IF "%1" == "" GOTO UsageExit
IF "%2" == "" GOTO UsageExit
if not exist %2\win.ini goto NoWin

CLS
echo 
echo 
echo                  ** ToolBook and ClipBook Installation **
echo                   Copyright (c) 1990, Published Perfection!
echo                      Install ToolBook at %1              
echo 
echo    The complete runtime version of ToolBook and ClipBook will be installed
echo    This install DOES NOT modify your config.sys or autoexec.bat files.
echo    If ToolBook is already properly installed your win.ini is NOT modified
echo    About 1.6 MB of free disk space is required for this install.
echo    ----------------------- CTRL-BREAK TO CANCEL -------------------------
echo 
echo 
PAUSE

IF EXIST %1\*.* GOTO Warn1
md %1
GOTO Setup1

:Warn1
CLS
ECHO                  ** ToolBook and ClipBook Installation **
ECHO                   Copyright (c) 1990,  Published Perfection!
ECHO               You requested installation of the software into %1˙.
echo 
ECHO        This directory EXISTS !
echo 
ECHO You will be asked to confirm˙any overwrites.
echo 
echo 
echo 
PAUSE
GOTO Setup1

:Setup1
CLS
ECHO                  ** ToolBook and ClipBook Installation **
ECHO                   Copyright (c) 1990,  Published Perfection!
echo 
ECHO Creating a backup copy of %2\WIN.INI (%2\win.pp)
ECHO    COPY %2\WIN.INI to  %2\WIN.PP
echo 
copy %2\win.ini %2\win.pp
IF EXIST %2\win.pp GOTO CopyOk
GOTO CopyError

:CopyOk
ECHO ˙
ECHO Updating %2\WIN.INI˙
ECHO ˙
tbw %2\win.pp %2\win.ini
if ERRORLEVEL 0 goto OKDone

ECHO ˙
ECHO Unable to modify win.ini
ECHO Original %2\win.ini is saved as %2\win.pp
copy %2\win.pp %2\win.ini
ECHO ˙
GOTO PromptExit

:OKDone
echo 
ECHO  Unpacking files and verifying archive...
pkunzip *.zip %1

REM add the following group for each additional disk

echo 

echo 
PAUSE



echo 
ECHO Installation completed!
ECHO Your software has been copied to %1
ECHO Launch WINDOWS and double click on CLIPBOOK.tbk to start!
GOTO PromptExit

:NoWin
CLS
ECHO                         ˙
ECHO ** Windows initialization file, %2\win.ini,˙NOT FOUND !!!
ECHO                                       ˙
GOTO Usage

:CopyError
CLS
ECHO                         ˙
ECHO ** Could not copy Windows initialization file, %2\win.ini !!!
ECHO ** Check disk space in %2
ECHO                                       ˙
GOTO Usage

:UsageExit
CLS
ECHO          ToolBook and ClipBook Installation
:Usage
ECHO Usage:   INSTALL TBOOKDIR WINDIR
ECHO ˙
ECHO Where:   TBOOKDIR is the directory where this
ECHO          software is to be installed.                (eg: C:\TBOOK)
ECHO ˙
ECHO          WINDIR specifies the full pathname where
ECHO          you installed Microsoft Windows 3.0         (eg: C:\WINDOWS)
ECHO ˙        The WIN.INI initialization file must exist
ECHO ˙        in this directory.
ECHO ˙
ECHO Example: INSTALL C:\TBOOK C:\WINDOWS
ECHO ˙
ECHO Notes:   A space is required between TBOOKDIR and WINDIR.
ECHO          You need about 1.6 MB of free disk space in your TBOOK directory.
ECHO          You must modify your path statement ONLY if you decide to store
ECHO          CLIPBOOK in another directory after this installation. Your
ECHO          path statement must point to the directory where TBOOK.EXE and
ECHO          the associated .DLL files are stored on your system. Your
ECHO          autoexec.bat and config.sys are NOT modified. This install will
ECHO          NOT modify your win.ini if ToolBook is properly installed. A
ECHO          backup copy of your win.ini called win.pp will be made before
ECHO          any modifications are performed. CTRL-BREAK TO CANCEL.
:PromptExit
