SETUP for WINDOWS APPLICATIONS
==============================

Why I Wrote this Program...
-----------------------------
SETUP is a simple installation utility that I wrote because
I needed to install a Delphi application I had just finished
writing.  I wrote SETUP in Delphi, so unfortunately, it's 
quite large (250 Kb).  If your application is not pressed for
diskette space, or you're already on multiple disks and 250 Kb
won't force another diskette, then this program may work for
you.


I wanted an installation program that would allow me to:

  >  Decompress and install files to the hard drive in
     a selected directory.  (Use MS COMPRESS.EXE)

  >  Run a program during (or after) the installation process.

  >  Build an installation set fairly easily.

  >  Install the BDE and update WIN.INI with the proper settings.

  >  Copy files to the Windows or System directories.

  >  Create a group and icons for the application installed.

  >  Control the installation process with a script file.

  >  Spend less than $50. (I didn't want to purchase a professional
     Install utility for over $100.)

Most of the other shareware install programs I tried did most,
if not all of these things.  One came really close -- it could
update the WIN.INI file with custom settings (hard-coded in the
script), but it couldn't update WIN.INI with user-supplied
information, such as the Destination directory or the BDE directory.
So I made my install capable of asking for and saving the application
and BDE destination directories.  The script file can reference
the user's input for these prompts by using "variables" in the
script commands.  That is, the script can then update WIN.INI
with the BDE (IDAPI) path entered by the user.  The other installs
I tried wouldn't allow me to do this.  Some would, but they cost more
than I wanted to spend.  So I wrote one myself.  Mine is not better
than all of these.  I didn't write this so I could sell it, either.
I wrote it because I needed an install program for future projects,
and I didn't want to spend $100 buying a really nice one.

The Disclaimer...
------------------
- I don't recommend this install to everyone.  I'm simply putting it up 
  here to give everyone another choice.  If you've looked at all the really
  good install programs and either like mine better, or you're as cheap as
  I am, I offer it for your use.

- My installation program is not extremely robust.

- It does not do alot of error-checking.

- It has a simple script language that will let you install most
  applications with a modest amount of preparation.

- It is not small.  It uses 250K on the first disk of your installation
  set.  I wrote it in Delphi, and that was as small as it would get -- it's
  not my fault!  In my case, it didn't matter, because my app was already
  using two diskettes, with plenty of space unused.

- I am not going to support this program.  I wrote it, it worked for me,
  it may work for you.  If it does -- wonderful -- register and distribute
  your application freely with it.  If it doesn't work for you, sorry --
  don't use it.


How to Use My SETUP Program...
-------------------------------
1.  Figure out which files you need to put on your distribution diskettes.
2.  Compress those programs (if you want to) using the Microsoft COMPRESS.EXE
    program.
3.  Write an installation script (SETUP.CMD) that will control the installation
    process.
4.  Copy SETUP.EXE and the script file (SETUP.CMD) to the first diskette.
5.  Copy the programs/files to the floppy diskettes.
6.  Create a small file (just a CR/LF will do) on each diskette with the name
    DISK2,  DISK3,  DISK4,  etc.  You don't need one on diskette 1.  This is
    how SETUP.EXE verifies that the correct diskette has been inserted.
6.  Test your installation!


Writing an Installation Script...
----------------------------------
The script file is a normal TEXT file that has one command per line, in the format

	COMMAND    arg1, arg2, arg3, arg4, ...

Arguments are parsed by the comma, so you don't need quotes around any arguments,
even those that contain several words with spaces between them.

The commands are as follows (in the order you'd most likely use them):

----------------------------------------------------------------------------------
TITLE   Title for Main Installation Screen

This command puts the title specified on the screen.  You should put this command 
first in your script so that the title appears soon after the program loads.  The
title always appears in White Times Roman Italic font on a blue background.
You cannot change the size or style.

ex:	TITLE   DynaWord Setup
----------------------------------------------------------------------------------
TOTALSIZE   nnnnnnnn

This command tells the installation program how many bytes make up all the
programs that will be installed.  You should do a directory of your 
installation disks, get the grand total of all diskettes, subtract the size
of SETUP.EXE and SETUP.CMD, and use that number (unless you only install 
some of the files on the diskettes for some reason).  If you have compressed
your files, this number represents the sum of the COMPRESSED sizes.  If your
files are compressed, this number is NOT the amount of space the installed 
files will use.  It is simply used to allow the percentage gauge to be 
accurate during the installation process.

nnnnnnn represents a long integer number in BYTES (not KB, not MB).

ex:     TOTALSIZE   1820500

----------------------------------------------------------------------------------
GETDEST    D:\DEFAULTDIR

This command tells the installation program to prompt the user for an 
installation directory -- where the user wants the programs to be installed.
The argument D:\DEFAULTDIR is the default directory that appears in the entry
field.  The path entered here can be refrenced later in the script using the 
%DEST% variable.

ex:	GETDIR   C:\DYNAWORD
----------------------------------------------------------------------------------
GETBDEDEST    D:\DEFAULTBDEDIR

This command tells the installation program to prompt the user for an 
installation directory for the Borland Database Engine.  If your app does not
use the BDE, then you don't need to use this command.
The argument D:\DEFAULTBDEDIR is the default directory that appears in the entry
field.  The path entered here can be refrenced later in the script using the
%BDEDEST% variable.

ex:	GETDIR   C:\DYNAWORD
----------------------------------------------------------------------------------
COPY   SourceFile, DestFile, SourceDir, DestDir, File Description

This command will copy a file from the floppy drive that was used to run SETUP.EXE.
The COPY command looks for a file with the name given as SourceFile, in the
directory given as SourceDir (on the floppy).  It copies that file to the filename
given as DestFile, and puts that file in the DestDir directory on the hard drive
specified by the user (as part of the GETDEST) command.  The File Description is
displayed on the screen to tell the user what is currently being copied.

ex:	COPY   DYNAWORD.EX_ , DYNAWORD.EXE, \ , %DEST%\    , DynaWord Program
or	COPY   IDAPI.CF_    , IDAPI.CFG   , \ , %BDEDEST%\ , BDE Configuration File

Copies the compressed program DYNAWORD.EX_ from the root directory of the floppy
diskette, to the destination directory entered by the user (including the drive).
Note the \ after the variable %DEST%.  This is needed since the Destination directory
is usually entered as D:\APPDIR, which will need another backslash after it before
we can append programs to it to arrive at a fully-qualified filename).  The program
is decompressed during this process.

If you are copying the BDE programs, use the %BDEDEST% variable in place of %DEST%
to send the files/programs to the directory specified by the user during the
GETBDEDEST command. Shown in second example.

You can also use %SYSDIR% and %WINDIR% to reference the \Windows and
\Windows\System directories.  See the sample script SETUP.CMD for usage.
----------------------------------------------------------------------------------
GETDISK   n,  Diskette Description

This command prompts the user to insert Disk #n, where n is an integer number.
The diskette is identified by a small file by the name DISKn, where n is the 
number of the disk you want the user to insert.
The Diskette Description is used as part of that prompt in the format:

		"Please Insert <Diskette Description> Disk <n>"

ex:	GETDISK   2, DyanWord Setup

(will display "Please Insert DynaWord Setup Disk 2" in a message box.)

----------------------------------------------------------------------------------
SETINI   INIFileName,  Section,  ItemKey,  Value

This command will update, or add to the .INI file given as INIFileName.  It will
create (or replace) entries in the section that have the key specified as ItemKey.
After the equal sign will be the string specified in Value.

ex:	SETINI   WIN.INI,  DynaWord,  DOCPATH,  %DEST%\docs

(this would create or change the section in WIN.INI called [DynaWord] to have 
an entry as follows:  	"DOCPATH=d:\dynaword\docs".  This assumes the user 
entered d:\dynaword during the GETDEST command.  The entries would look like this:

[DynaWord]
DOCPATH=d:\dynaword\docs
-----------------------------------------------------------------------------------
CREATEGROUP   GroupFileName, Group Description

This command creates a group with the filename given in GroupFileName (usually:
filename.grp).  It puts the Group Description into the Caption area at the top
of the Group, or below it if it is minimized.

ex:	CREATEGROUP   dynaword.grp,  DynaWord Word Processing
-----------------------------------------------------------------------------------
CREATEICON   FileName, Icon Description

This command creates an icon in the group that "points" to the program or file
given as FileName.  That icon is given the description specified in Icon Description.
Note: You should call CREATEGROUP just before creating any icons to make that the 
current group to recieve icons -- otherwise, the results are undefined.

ex:	CREATEICON   %DEST%\dynaword.exe,  DynaWord Program
-----------------------------------------------------------------------------------
RUN    SomeEXE  arg1  arg2  

This command runs the program specified as SomeEXE and sends it the arguments
arg1 and arg2.  You can acutally have up to 6 arguments sent to the program 
(each script line is limited to 8 arguments total).

ex:	RUN   NOTEPAD %DEST%\readme.txt

(This will display the readme.txt file copied to the Destination directory
by using notepad.exe to view it.)
-----------------------------------------------------------------------------------
END   EndingMessage

This command ends the installation and displays a message.  It should be used as the
last entry in your script as follows:

ex:	END   DynaWord Installation Complete!
