Questek Application Installer for Windows 3.1 and 95 

  		     version 1.102
----------------------------------------------------

Contents

a) About this application / disclaimer
b) Features
c) Installation manager.
d) Installation Programs
e) File Compression
f) File descriptors
g) Files vs disks
h) About Uninstallations
i) AUTOEXEC.BAT and CONFIG.SYS files
j) Spawning programs during installation
k) The order of things...
l) Traps and things...
m) Background of Installation program window
n) Last word




a) About this application
-------------------------

This is the third release of the "Questek Application Installer" 
utility. This program is released as "Freeware", you may use
it to your hearts content, copy and distribute it as you whish
but you may not charge for it in any way with the exception of
a reasonable "media" fee.
I only ask that you include this "readme" file.

This program is the result of an attempt to write a general
purpose installation utility that is targeted for use with
Borlands Delphi but may be used to install anything (almost).

I have written this program to suit my own needs (and that of
my company). It does most things you would expect of a 
reasonable installation program. 
The company I work for "QUESTEK Marketing" has given permission
for the release of this software as "FREEWARE".

I am releasing this program on an "as is bases", no guarantees
whatsoever exist, no responsibility on my part will be accepted
for any problems arising out of the use of this program or any
of its parts. (Even if it results in WW3)
You as the user accept this by the simple means of using my
program. Anything that follows is your problem !

If bugs are found (and I am sure there are some...) you may
contact me on the net at

	Rainier.Lamers@pixie.co.za

Any info on whether or not you like the program, suggestions,
bug reports will be gratefully accepted.
At this point in time no nice "help" files or manuals exist,
only this "readme" file. I simply do not have the time
to write them at the moment. If you REALLY get stuck and this
file does not help you, contact me.

Please do not complain about this too loudly, after all, what
you are getting here is for free, nothing, zilch !

Finally, the reason for me releasing this program is to say
"thank you" to the delphi community which produces freeware
components, faq's, documents, etc on a really good scale. These
have helped me tremendously and some of that resulted in
these programs.

I would also like to thank all those who E-Mailed me :)
in connection with this application. Thanks for the
bug-reports, comments and suggestions. They help to
make this application a better one !

b) Features
-----------

No script files with hard to remember syntax.
Any number of files on up to 26 disks.
One program manager group with "unlimited" icons.
Create a "new" group or choose from any existing group.
Icons for any install file (where applicable) as well
as for "notepad" readme files, windows help files etc.
Up to four installation paths each with unlimited
subdirectories (one level).
Installations to windows and windows\system directories
and subdirectories thereof.
Install files may be grouped for up to 9 user install options.
Spawning of Borland's BDE, Reportsmith and SQL links setup.
Spawning of any other setup program (Crystal reports, etc).
Spawning of any executable (DOS or Windows).
Example: run Notepad with a readme file after installation
completes.
Distribution of compressed or un-compressed files.
INI file manager - Create files, add sections, items etc.
AUTOEXEC.BAT and CONFIG.SYS file manager - create
entries, paths, enviroment variables, install drivers, etc.
File editor allows user to determine changes to these
files where the user does not want the settings your setup
dictates.
Pre and post installation messages to the user.
File version checking for anything going to the windows
or windows\system directory. Only files of the same
or later version number will be installed.
Files that do not have version info will always be
installed.
Creation of "uninstall" information in target directory.
Complete uninstallation of an application. Each file may
be tagged as "not uninstallable" (common DLL's etc).
Uninstallations include changes made to INI files,
AUTOEXEC.BAT and CONFIG.SYS.

New with version 1.1:

Support for BMP image used for background during 
installation, image may be centred, tiled or
fitted into the upper left corner of the main
installation program window.
User defined Title for installation.
Fore- and background color settings for Installation
Title and Copyright message.
Support for un-installation of files not created during
installation (using wild card file specs...)

The user may now enter install directories longer
than the previous restriction of eight characters.
Windows 95 long filenames are NOT yet supported.
(guess I got to find out how first...)

Planned for the future: 

a) Support for non-English language installations.
b) You tell me...

c) Installation manager.
-----------------------

"SETUPMNG.EXE"

This program executes on your development platform. It's duty
is to maintain information on one or more projects, as required
to create installation disks.

Managing the various installation options is done here,
maintenance of a database containing all files needed for
the installation and their locations, specifications on the
destinations for these files and optional parameters as required.

Files may be distributed "as is" or compressed using Microsofts
"COMPRESS.EXE". (This file must be installed in the Windows
directory if used...).

Use of this program is pretty straight-forward, so I hope 
you will come right using it without there being a help-file...

d) Installation Programs
------------------------

"SETUP.EXE" and "HDSETUP.EXE"

SETUP.EXE is a small bootstrap loader. It will install
HDSETUP.EXE on the target machine and then start it.
Once the installation is complete, SETUP.EXE is again run
to remove HDSETUP.EXE from the target machine.

Note: HDSETUP.EXE will attempt to use CTL3DV2.DLL, but will
run OK if it is not present on the target machine.
You may place a copy of CTL3DV2.DLL onto installation disk 1
(using SETUPMNG.EXE as with any other file).
SETUP.EXE will then copy this file to the windows\system
directory before launching HDSETUP.EXE.

e) File Compression
-------------------

All installation files may be compressed using Microsoft's
"COMPRESS.EXE". This file must be installed into the
windows directory.

In order to use compression, create a directory to hold the
compressed files. I recommend one directory for every
application to avoid filename conflicts.

In the "disks" section of SETUPMNG.EXE, assign all files
to installation disks. Set the "compress directory" field
to point to the directory you want to use to hold the
compressed files.
Press the "compress now" button.
When finished, check the "use compressed files" checkbox.
That is all.
Note: Read the section on "traps and things".

f) File descriptors
-------------------

In SETUMMNG.EXE you will come accross install files
listed in a format like:

X1\        -C:\MYDIR\MYFILE.EXT
|||        ||
|||        ||-> this is the source path and filename
|||        |--> "-" file is "un-installable"
|||             "!" file may not be "un-installed"
|||-----------> optional subdirectory of install path
||------------> "1"-"4" install path 1 to 4
|               "W" windows directory
|               "S" windows system directory
|-------------> "X" always install this file
                "0" to "9" install option 1 to 10

Icon descriptors may look like:

X1\        -MYFILE.EXE{parameters}[descriptor]
|           |          |           |
|           |          |           |-> icon descriptor
|           |          |-> optional command line
|           |              parameters
|           |-> the target file containing the icon
|-> path and install options as above with one more
    possibility. The "X" position may become a "?"
    This means: Path not known. Windows to search.

g) Files vs disks
-----------------

I have come across many a time when a file on an
installation disk has been corrupted for
reasons beyond my admittedly simple mind.
However, some things can be done to improve matters:
Don't fill a disk to the last byte !
Start with empty, formatted disk(s) and if possible use
only 70-80 % of its capacity. This way files will not be
stored on the innermost tracks (these have the highest
density - bits per inch).
I have often found tracks 70-80 on a 1.44 MB stiffy to
be somewhat less reliable than other tracks.

SETUPMNG.EXE returns the amount of diskspace required
for each disk. This may be used as a guideline as to
how full a disk will get.

Note: The diskspace required field is not too accurate
as it assumes 2048 byte clusters regardless of disk type.
So don't fill a disk to the last byte - That byte may not
exist !
If you really have to squeeze, leave at least one KByte.
I will probably improve this in a later release.

h) About Uninstallations
------------------------

It may be optionally specified to allow the user to
uninstall an application.

If you make use of this option, evaluate each file as
to whether it should be removed from the target system.
Each file may be tagged as "allow uninstall" in the
"set destinations" form.

Basically, do not remove a file that another application
may require, even if your installation has been
responsible for introducing the file in the first place !

Consider this example:

Your installation executes and installes "BWCC.DLL" into
the windows\system directory. The file was not present on
the target system before.

Another installation is done (not yours), also installing
"BWCC.DLL".

You execute your installation again, electing to
un-install the application. Allthough your setup "knows"
that "BWCC.DLL" has been installed through it, it
must not be removed as the other application relies on
it !

In short, any DLL or other file (drivers, etc) likely to
be used by other applications, install them but tag them
as not removable.

Any DLL or driver that you created and you know will not
be used by anything but your application may be safely
removed.

Uninstallations are also possible on any changes made
to AUTOEXEC.BAT, CONFIG.SYS and any INI or INI file
structure compatible file. In case of AUTOEXEC.BAT and
CONFIG.SYS files, you may specify every item to be
uninstallable or not (appart from global overrides).
In case of INI files you may specify globally whether
to allow uninstallations or not.

Note that only files installed will be uninstalled.
Files and directories created by your application will
not be removed. Should this result in the installation
directories not being deleted, the user will be informed
of this. He (or she) should then have a look at the
remaining files and delete them if they are no longer
required.
You could be sneeky though. Have a look at the
UNINST.INF file that gets created in your
installation directory 1. If your application where
to add file references for files it creates, these
files would be removed by the uninstallation process !

New with version 1.102 is the capability to include
specifications for any file (or files) to be un-installed
other than the files installed during installation.
Simply add as many filespecs as you need.
Examples:

%1\*.DBF
%1\MYSUB\*.*
%S\MYDLL.DLL

Be carefull with this though, you could easily wipe
some of your customers hard-drive with this !

i) AUTOEXEC.BAT and CONFIG.SYS files
------------------------------------

Ay, here's the rub! These files have a long history and
definitely many fathers !
Nevertheless, with the tools included, most things you
might want to do to these files can be done.

First, the AUTOEXEC.BAT file:

Two possible types of entries may be made:

ITEMS and SUBITEMS.

The ITEM:
---------

Items are string objects that should occupy a full line in
the target file. A simple syntax is used to define such an
item:

-,ITEM,"SET MYENV=","SET MYENV=%1"
| |     |            |
| |     |            |-> this is the string you want to
| |     |                insert. Note %1 gets replaced
| |     |                by install path number 1.
| |     |                The quotes are necessary if
| |     |                spaces are used.
| |     |-> this is a "search keyword". The program will
| |         try and find a line containing this string
| |         and then allow the user to decide whether
| |         to replace the existing entry. This will
| |         only happen if the new string is in any way
| |         different from the old one. Lines starting
| |         with "rem" are not considered.
| |-> this tells the program that you want to insert
|     an "ITEM".
|-> use a "-" if the item may be uninstalled or use
    a "!" to prevent uninstallations of this item.

The above example creates the line:
SET MYENV=C:\MYPATH (if that is your install path 1)

The SUBITEM:
------------

A subitem is a comma-delimited part of an item. Example:
DATABASE=DBASE,PARADOX,MSACCESS

In the case of autoexec.bat files and only in case the
item name is "PATH" the delimiting commas are replaced by
semicolons (;).

-,SUB,"PATH","%1"

This works as above but creates:

PATH=C:\;C:\path1;C:\path2;C:\MYPATH
                           ---------
if the path does not yet include your path.

Now the CONFIG.SYS file:

Nothing much to say: works just like the autoexec.bat.
Don't try the "PATH" thing though...
(subitems do work however...)

A note on %1..%4, %W, %S install path place holders
---------------------------------------------------

These place holders may be used whenever is is required
to refer to one of the install paths. These place holders
never return the trailing backslash. Should you require 
one, simply add it yourself. Example: 

-,ITEM,"SET MYENV=","SET MYENV=%1\DATA"
                                 ^

j) Spawning programs during installation
----------------------------------------

I have included a small program "ALIAS.EXE" as example
of how to extend the installation programs capabilities
to preform "special" tasks. 
One such task would be for delphi programmers to set
a "alias" for a database connection. "ALIAS.EXE" can do
this. Simply spawn it, with the "wait for completion"
option using the following command line parameters:

Example: You want an alias name of "MYALIAS", the path
of the alias is the same as your install path number 1 
and the database type is "dbase".

You would include "ALIAS.EXE" as one of the files installed
say to install path 1.

You would then spawn "ALIAS.EXE" with the following
syntax:

W%1\ALIAS.EXE,"MYALIAS %1\ DBASE"

Note the quotes. They are necessary as the command line
argument contains spaces.

Valid database types are DBASE, PARADOX and ASCII.
 

k) The order of things...
-------------------------

Basically what happens in what order:

1) run setup from installation disk
2) setup.exe checks for CTL3DV2.DLL, if found checks
   for existing file, checks versions and copies if OK.
3) copies hdsetup.exe to harddrive either to temp
   directory or if not found to C:\.
4) same with setup.inf
5) starts hdsetup.exe on harddrive
6) hdsetup asks for install paths
7) hdsetup asks for user options (if any)
8) hdsetup installs all files
9) hdsetup spawns external setup tasks
   order: 	setup BDE
   		setup reportsmith
		setup SQL
		setup generic
10) hdsetup runs INI file edit
11) hdsetup runs autoexec.bat edit
12) hdsetup runs config.sys edit
13) hdsetup asks for group (if enabled)
    then makes group and icons
14) hdsetup runs external tasks
    (the order is same as creation
     order in setup manager)
15) hdsetup asks for disk1 (if necessary)
16) hdsetup starts setup.exe with instructions
    i.e: restart windows, system..
17) hdsetup terminates
18) setup.exe removes hdsetup.exe and setup.inf
    from harddrive, then terminates while
    restarting windows or system as required.

l) Traps and things...
----------------------

DON'T spawn another setup that has been done using this
setup program. It ain't going to work (sorry...).
DON'T name the INF program that is going to hold your
applications setup info "setup.inf" (that name is RESERVED).
Rather name it "mysetup.inf" or "myapp.inf" or whatever.
  
All install files on the distribution disk are stored with
the last character of the extention being a '_' (underscore).
So what do you do if you want to distribute the following
files:

MYFILE.DT1
MYFILE.DT2

Well, the only thing that you can do is to distribute them on
two seperate disks (easy to organize using the setup manager). 

BIG IDEA: PKZIP all files with problematic extentions into one
zip file (self extracting is nice...) and then simply run pkunzip
(which you have distributed on your install disk as well...) with
the required command line parameters (or simply run the self-
extracting archive...).

Note: you can spawn dos exe's and dos bat files as external tasks
as well !!! (possibilities galore...)

DON't try and distribute files that are currently in use by your
system. (Works most of the time but not in all cases...)
If you have to, make sure that "share.exe" is not running.
A warning to this effect will be displayed if share is detected.

m) Background of Installation program window
--------------------------------------------

Normally, the background will fade from the background color
chosen for the title (top) to the color chosen for the copyright 
string (bottom).

You choose the colors using the setup manager.

You may want to further enhance and personalize the appearance
of the setup during execution. You have several options:

1) A bitmap image tiled to fill the backgound from the bottom edge
of the title to the top edge of the copyright string. 
If the tile is '' (empty), the image will be tiled from the top
of the client area of the window. If you do not want the copyright
string to appear, specify 'NoCopyright' (exactly like that, no 
quotes) as your copyright string. The image will then be tiled
right to the bottom of the client area.

2) A bitmap centered in the setup main window. This bitmap should 
be sufficiantly large (say about 300 x 200 minimum), to not get
covered fully by any dialogs (which always appear centered...).

3) A bitmap positioned in the upper left corner of the window, just
below the title and slightly to the right.

Your bitmap must be in windows BMP format (I recommend using only
16 colors for compatibility reasons with other systems...).

The bitmap file should have a BM_ extention and you must get it
copied onto your first installation disk. Specify it as you
would any other file using the setup manager. It will end up
getting copied to whatever destination directory you specify. If
you do not want this to happen, specifiy this file to be
"setup only" using the options provided in the file
destinations dialog (setup manager).

Specify the name of the BMP file under the "MISC" tab of the
setup manager and choose whether to center, corner or tile the
image.
Note: The BMP file may be compressed using Miscosoft's 
COMPRESS.EXE...

Choose the for- and background colors for title and copyright
notice, keep in mind that your choice of background colors will
be used to create a 'fade from - to' type background.

Using a good color scheme for the background plus a suitable image
quite striking effects can be made.
Some of your clients may install using a monochrome monitor.
Keep this in mind when choosing your colors.
 
n) Last word
------------

Whether you are creating a simple installation or a big
complex one. TEST YOUR INSTALLATION in every concievable
way. Yes I know its easier said than done!
If you allow uninstallations, test that too.
Your stuff may be perfect, but is this setup program as
perfect ? It can do so many things in so many different
ways that I just do not have any chance of testing it all...

The setup manager does not spend too much effort in 
ensuring that you do everything legally (O.K. the 
programmer (me) did not spend too much effort...)
Basically, if you are going to use this stuff, then you are
obvioulsy a crack windows programmer anyway. You will not
make any mistakes now would you ?

HDSETUP.EXE and SETUPMNG.EXE are written using Delphi 1.0
SETUP.EXE is written using Turbo Pascal for Windows 1.5

Have fun :)

Rainier Lamers
P.O. Box 286
Randburg 2161
Republic of South Africa

E-Mail
Rainier.Lamers@pixie.co.za

