


COMPACK 5.1 User Manual                               Page 1



       COMPACK 5.1 
DOS Program Compaction Software

       USER MANUAL 


                             CONTENTS
                                                          Page
     Installation                                           1
     Distribution                                           2
     Getting Started                                        2
     Rationale                                              2 
     How COMPACK works                                      3
     Real Time Environment                                  4
     Some typical compression statistics                    5
     COMPACK Syntax                                         5 
     Command Line Options                                   6
     Examples                                               6
     Hardware and Software Requirements                     7
     COMPACK Error Messages                                 7
     COMPACK Warning Messages                               8
     Optimising COMPACK                                     8
     Using REPACK                                           8
     Multi-Segment COM Programs                             9 
     Single-Segment EXE Programs                            9 
     Compacting BIOS Files                                  9
     Compacting Device Drivers                              9
     Problem Cases                                          10
     Known Anomalies                                        10 
     Answers to some common questions about COMPACK         12
     Self Extracting Program Creator                        14 
     Syntax                                                 14
     Example Use                                            14
     Execution of the SFX                                   15
     Using SFX programs on Single Diskette Systems          15
     Minimising SFX Disk Size                               15 
     Acknowledgements                                       15



    Installation                                          #
                           INSTALLATION

COMPACK is supplied as a  self  extracting  file  (created  using
COMPACK's -B option).  To install the software select a  suitable
directory as the default and execute the program CPK51.EXE.  This 
will automatically create all the files in the current  directory
(overwriting any files with the  same  name).  (If  you  wish  to
extract files on a one diskette  drive  system,  you  may  change
diskettes after the opening prompt).  Be sure to  read  the  file
README.CPK.  COMPACK can be speeded up by setting the  DOS  envir
onmemt variable TMP to a RAM disk.  (ie SET TMP=D:\).&



                Prominence Computer Services Ltd. 
Strada Sottopiazzo 18, 14056 Boglietto di Costigliole (AT), Italy. 



    Copyright (C) Prominence Computer Services Ltd. 1990-1993








COMPACK 5.1 User Manual                               Page 2


    Distribution                                          #
                           DISTRIBUTION
 
COMPACK  is  the  copyrighted  property  of  Prominence  Computer
Services Ltd., and is distributed as Shareware.  As such, you are 
free to use and copy the software for  non  commercial  purposes.
The software may not be  modified.   If  you  find  the  programs
generated  useful,  then  a  contribution  of  US  $25  would  be
appreciated.  If you send $40 or more  you  become  a  registered
user and will be sent the latest version of COMPACK with  printed
manual.  

If you  use  COMPACK  or  COMPACKted  programs  in  a  commercial
environment  or  government  institution  then  registration   is
obligatory.   Commercial  distribution  of  COMPACKted   programs
requires a written agreement  (not  required  for  compaction  of
public  domain  software  or  shareware  by  'not   for   profit'
organizations so long as credits are given in  the  documentation
or program).  Commercial users  wishing  to  distribute  programs
compressed by COMPACK should contact Prominence Computer Services 
Ltd. for further details.  



    Getting Started                                       #
                         GETTING STARTED 

COMPACK transforms your DOS programs, both EXE and COM files,  to
load faster and take up less space on disk!  You  don't  need  to
read this manual to start using COMPACK.  Like all good software, 
COMPACK comes with help already built in.  Just  enter  "COMPACK"
at the DOS prompt for a  summary  of  the  syntax  and  available
options.  The rest of this manual is really only for reference.



    Rationale                                             # 
                            RATIONALE

Hard disk are always too small, modem bills too high, and network 
response time too slow.  The classic solution to  these  problems
has been to compress the  data  before  transmission  or  backup.
There are several archive utilities to compress files into  "LBR,
"ZOO",  "ZIP",  "ARC",  "PAK",  "LZH"  and  similar  incompatible
formats.

These utilities work fine when the objective  is  archiving,  but
access to data, (ie running a  program)  requires  an  additional
decompression utility and this adds  delay  and  complexity.   To
hide this complexity many software distributors  are  obliged  to
create bulky installation procedures, somewhat counter-productive 
when the aim is to reduce media  costs.   In  fact  most  archive
expanders are not suitable for software distribution.  First  the
expansion program itself may take up tens of thousands  of  bytes
of overhead.  Secondly file compression  is  compromised  by  the
need  to  maintain  the  archive  updatable.   Neither  of  these
"features" may of any use to the poor computer  user  who  simply
wants to use his software with the minimum of expense and delay.  


    Copyright (C) Prominence Computer Services Ltd. 1990-1993








COMPACK 5.1 User Manual                               Page 3



COMPACK therefore is not an archiving program.  It is  a  utility
which simply compresses DOS programs.   The  compressed  programs
will run the same as before without the use of any extra software 
or hardware.  This is an important  advantage  because  it  means
that compressed software is portable.  There is no  risk  that  a
program  will  not  run  because  an  essential  utility  is  not
available.  

Unlike other software,   the  expansion  code  does  not  disable
interrupts  for  extensive   periods   (less   than   10uS)   and
consequently compacted programs work correctly  even  in  a  real
time environment (such as a network).   Furthermore  no  messages
are embedded in the code so  foreign  language  programs  can  be
compressed without problems.  There are  no  DOS  calls,  so  the
software you compress today should  work  with  future  operating
systems.  In fact COMPACK can compress BIOS routines  which  will
expand themselves at bootstrap time when DOS has not been loaded.  

With few exceptions COMPACK will compress programs  smaller  than
the better archive utilities.  As for speed, COMPACKted  programs
really load faster!  COMPACKted programs running on floppy  disk,
CD-ROM, or over networks will typically respond in half the  time
of their bulky predecessors.  At the other extreme, on a fast RAM 
disk, there may be a small additional delay (perhaps up to a  few
tenths of a second).  Of course such delay is barely  perceptible
and is compensated by the ability to fit even more  data  in  the
RAM disk.


    How COMPACK works                                     #
                        HOW COMPACK WORKS

In  simple  terms,  COMPACK  compresses  the  input  program  and
sandwiches the result between header and trailer code.  Under DOS 
3.X and later the input file is opened DENY_WRITE preventing  any
other process (including COMPACK itself or other  network  users)
from overwriting.  (Your operating  system  may  not  offer  this
protection unless SHARE is loaded).  

The extra header and trailer code amounts to just a  few  hundred
bytes and is responsible for recreating the exact  image  of  the
uncompressed program and passing control  to  it.   The  code  to
expand COM files is smaller and faster than the  code  to  expand
EXE files.  The compression algorithm is based  on  Lempel  Ziv's
first proposal, a sliding window algorithm.  (This  algorithm  is
distinct from their second proposal, also known as the Lempel Ziv 
Welch algorithm.)

COMPACK replaces repeated byte strings by shorter  references  to
previous  identical  strings.  This  is   called   substitutional
compression (as opposed to statistical  compression).   There  is
nothing original in this, almost all modern software or  hardware
compressors in the past few years have used a variation  on  this
basic method.   Common  variations  include  a  second  phase  of
statistical compression whereby frequent references  are  encoded
in fewer bits than less frequent ones.   Statistical  compressors
have been applied  successfully,  for  example,  in  the  Huffman


    Copyright (C) Prominence Computer Services Ltd. 1990-1993








COMPACK 5.1 User Manual                               Page 4


encoding of LZH  archives  (hence  the  name)  and  Shannon  Fano
encoding of ZIP archives.

Combined with  the  prior  phase  of  Lempel  Ziv  substitutional
compression, these techniques achieve excellent  compression  but
are not suitable for compressing programs  for  several  reasons.
First the expansion algorithms  are  complex,  adding  a  certain
amount of overhead.  Secondly they  tend  to  be  slow.   Thirdly
memory requirements can be high, and  there  simply  may  not  be
enough memory for both tables and a large program simultaneously. 
It would be a pity if large programs, which have the most to gain 
from compression, could not be expanded again!

COMPACK manages to avoid  these  disadvantages  whilst  achieving
even  greater  compression.   There  is  no   second   phase   of
statistical  compression.  Memory  requirements   are   minimised
because there are no tables.  The simplified expansion code takes 
up just a  few  hundred  bytes  adding  little  overhead  to  the
COMPACKted program.  Simplicity  implies  speed:   the  expansion
code executes between 3 and 20 times faster than similar  archive
utilities.   Disadvantages?   Well,  to  achieve   the   superior
compression COMPACK analyses the program to be compressed in some 
detail, and this takes time.  We feel it is worth investing  this
time once and recouping the speed and space savings whenever  the
program is run.


  Real Time Environment                                   #
Real Time Environment

Many PC applications are finding their way into  networks,  multi
tasking  platforms  and  real  time   applications.    In   these
environments  a  program  which   disables   interrupts   for   a
significant amount  of  time  is  considered  ill  behaved.   For
example,   disabling   interrupts   could   cause   a    resident
communication program to lose  a  character,  (and  probably  the
entire packet).  If you are already having problems of this  kind
with programs compressed by other utilities, COMPACK may  be  the
answer.   COMPACKted  programs  have  no   additional   interrupt
latency.

Newer operating systems (MS-DOS 5.0, DR-DOS 6.0) sometimes  abort
loading certain EXE style programs with the message, "Packed file 
corrupt".  This problem is caused by a particular combination  of
CPU type (ie 80286 and  later),  relocation  table  address,  and
packing algorithm (EXEPACK, PKLITE etc).  These problems  do  not
apply to COMPACK.  If you get this message try using REPACK  (see
later in this manual) to convert the corrupted program to COMPACK 
format. 


    Some typical compression statistics                   #
      Some typical compression statistics using COMPACK 5.1

                   Original      Compacted    Reduction    
                     Size          Size          %

     CYCLONE.COM     5632          3644         35


    Copyright (C) Prominence Computer Services Ltd. 1990-1993








COMPACK 5.1 User Manual                               Page 5


     COPYWRIT.COM   34784         17534         50
     TCC.EXE       179917         85292         52
     TC.EXE        290249        156876         46
          COMPACK - COM and EXE File Compacter program 

    COMPACK Syntax                                        # 
SYNTAX

     COMPACK  \path\program.in \path\program.out [msg] [-options] 

The filename must normally be unambiguous (no '*' nor '?').   The
third  parameter  is  an  optional  message  which  is  appended,
uncompressed, to the output  program.   This  might  be  used  to
include  a  serial  number  and  or  copyright  notice.  Messages
embedded in the program code will of course  be  compressed,  and
therefore may not be visible unless displayed by the program.












































    Copyright (C) Prominence Computer Services Ltd. 1990-1993








COMPACK 5.1 User Manual                               Page 6


    Command Line Options                                  #
Command Line Options

Options always begin with the "-" character and may occur in  any
order, even mixed up with the  other  arguments.   The  following
letter may be in either upper or lower case.


 -r  Forces program compaction to continue  regardless  of  error
conditions: presence  of  debug  information,  prior  compaction.
In addition the  option  supresses  the  internal  conversion  of
multi-segment COM files, single segment EXE files.

 -o   Displays  the  order  form  on  the  screen.   (Print  with
PrintScrn key).

 -i  Causes COMPACK to abort compaction  if  it  can  identify  a
possible optimisation of  the  input  program.   See  section  on
Optimising COMPACK. 

 -g  Speeds up compression (by  about  50%)  at  the  expense  of
program size (about 1% larger).

 -h  Most linkers produce EXE headers which are a multiple of 512 
bytes so there may  be  considerable  unused  space.   Using  the
"-h" option  normal  EXE  program  compression  is  bypassed  and
COMPACK simply  attempts  to  reduce  the  header  to  a  smaller
multiple of 16 bytes.  

 -v  This option specifies  that  the  input  program  should  be
unCOMPACKted.  This  works  only  with  the  current  version  of
COMPACK and  allows  complete  recreation  of  COM  programs  and
partial recreation of EXE files.   This  option  is  designed  to
allow   virus   scanning   and   similar   programs   to    check
COMPACKted programs.  EXE programs  expanded  in  this  way  will
be  non-functional  (having  no  program  header  nor  relocation
information).   This  non  functionality  is  deliberate,  as  we
do  not  wish   to   encourage   unauthorised   modification   of
commercial software.

 -b  This specifies the BUILDSFX option used to create  a  single
program which can  create  multiple  data  files  when  executed.
Full details are explained further on in the text.


    Examples                                              #


Examples

    COMPACK bigprog.exe -g fastprog.exe
    for %q in (*.com) do COMPACK %q d:%q -r
    for %q in (*.exe) do COMPACK %q d:%q "Copyright (c) Fox 1993"
    COMPACK \DOS\DEVICE.SYS A:DEVICE.SYS

    Hardware and Software Requirements                    #
Hardware and Software Requirements (Version 5.1)



    Copyright (C) Prominence Computer Services Ltd. 1990-1993








COMPACK 5.1 User Manual                               Page 7



               RAM               DOS            CPU

COMPACK.EXE    512 kBytes        2.0 or later   8088 
program.com     65 kBytes        None           8088  
IO.SYS          65 kBytes        None           8088  
program.exe    Extra 2k          None           8088  
device.bin     Extra 512 bytes   None           8088  
device.exe     Extra 2k          None           8088  



    COMPACK Error Messages                                #
                     COMPACK Error Messages 
                                                             Exit
                                                             Code

     Insufficient memory                                     3
     Error writing output program                            3
     EXE header too large at XXXX bytes                      3
     Unsuitable Overlay file                                 3
     Unsuitable HIGH loading EXE file                        3
     Cannot open FILENAME                                    3
     Insufficient Saving.  Program not compacted.            3     
     COM file > 64k Bytes                                    3
     EXE program contains excess debug info or overlays.     3
     Invalid EXE header.  Relocation overlap.                3
     Input and output filenames must be different            3
     COMMAND.COM should not be COMPACKted                    3
     Invalid EXE header.  Actual length less than Reported   3



All the above error messages are  fatal,  causing  the  immediate
termination of the program.

Note the error message regarding excess debug information.   This
condition is noted when the DOS file size is longer than the file 
size registered in the EXE file header.  It is possible that  the
excess data is an overlay or other essential information which is 
read from disk at execution time.  This condition is considered a 
warning if the "r" (retain) option is specified.  Naturally  such
programs may not function correctly when compacted so testing  is
essential.

    COMPACK Warning Messages                              #
                     COMPACK Warning Messages

     Warning: Multi-segment COM file.
     Warning: File may have been already compressed with EXEPACK.
     Warning: It may be possible to convert file to COM format.
     Warning: No significant saving - new program created anyway.


Warning messages are purely informatory and point out some format 
of  the  source  program  file  which  deserves  attention.   For
example, the possibility of using  PKLITE  to  convert  compacted
programs  back  into  the  original  format.    Similarly   other


    Copyright (C) Prominence Computer Services Ltd. 1990-1993








COMPACK 5.1 User Manual                               Page 8


utilities may strip off debug  information.   These  are  usually
included with the compiler or operating  system.   In  all  cases
even greater execution  speed  and  smaller  programs  should  be
possible.  In the next section we will see how to transform these 
programs into a more simple and suitable format for compression.


  Optimising COMPACK                                     #
                        Optimising COMPACK

COMPACK obtains best results when it compresses a program in  its
most simple format.  By using the -i command line option  COMPACK
attempts identify what kind of program is  being  compressed  and
returns with a DOS error code.  This is  used  by  REPACK.BAT  as
outlined below.


     Exit Code      Program Type

          19        COM program already compressed by DIET
          18        EXE program already compressed by DIET
          17        COM program already compressed by PKLITE
          16        EXE program already compressed by PKLITE
          15        Already compressed by LZEXE
          14        COM Device Driver
          13        EXE Device Driver
          12        Convertible to COM format with EXE2BIN
          11        Already Packed by EXEPACK
          10        Multi-segment COM program
           9        COMPACKted EXE program
           8        COMPACKted COM program
           3        Error


    Using REPACK                                          #
                          Using REPACK 

To automate the  process  of  converting  programs  into  a  more
efficient format before using  COMPACK  you  can  use  the  batch
command  file  REPACK.BAT.   REPACK  may  use  utility   programs
supplied by third parties to for the conversion.  It  is  invoked
in the same way as COMPACK :-

     REPACK bigprog.exe smallprog.exe


    Multi-Segment COM Programs                            # 
                   Multi-Segment COM Programs 

Many system files supplied with DOS operating systems  use  a  so
called multi-segment COM file.  COMPACK automatically  recognises
this format whilst compressing a file and  normally  converts  it
internally to the smaller EXE  format  before  compression.   The
conversion can be prevented by using the -r switch. 

Multi-segment COM files are  small  EXE  files  which  have  been
converted to COM format by a proprietary utility.  The format  is
used in various system programs supplied with PC-DOS  and  MS-DOS


    Copyright (C) Prominence Computer Services Ltd. 1990-1993








COMPACK 5.1 User Manual                               Page 9


(for example CHKDSK.COM).  The purpose  of  this  format  is  not
clear because it results in larger COM files  which  load  slower
than their EXE counterparts.


    Single-Segment EXE Programs                           # 
                   Single-Segment EXE Programs 

You may be already familiar with the DOS  utility  EXE2BIN  which
can convert certain certain  simple  EXE  files  to  smaller  COM
format.  COMPACK  automatically  recognises  this  format  whilst
compressing a program or device driver and normally  converts  it
internally to the smaller COM  format  before  compression.   The
conversion can be prevented by using the -r switch. 


    Compacting BIOS Files                                 #
                      Compacting BIOS Files

IO.SYS and IBMBIO.COM may be successfully compressed  by  COMPACK
even though strictly speaking they are neither COM nor EXE  style
files.  COMPACK takes care of all the details without any special 
options.  Neither MSDOS.SYS nor IBMDOS.COM may  be  compacted  at
present as there is no standard way of executing these modules.


    Compacting Device Drivers                             #
                    Compacting Device Drivers


COMPACK  is  able  to  compress  most  device  drivers   (usually
specified in the CONFIG.SYS file).  Recent versions  of  DOS  are
able to load EXE style drivers with headers specifying relocation 
tables.  COMPACK recognizes a driver when the first  4  bytes  of
the image are all  set  to  hexadecimal  FF.   This  would  be  a
nonsence code for a COM file  which  starts  executing  from  the
beginning of the  image  but  might  be  permissable  in  an  EXE
program.  In fact there are some very rare files which  are  both
programs and drivers!  COMPACK does not currently  compact  these
appropriately!

Some (all?) versions of DOS do not make appropriate  checks  when
loading a driver that requires more space than the  actual  image
size (even when the EXE  header  specifies  that  such  space  is
required).  This may cause problems when a driver  loads  into  a
physically small "hole" in memory and  will  probably  cause  the
computer to hang.  The same problem occurs  with  normal  drivers
that require more memory than there image size.  This is  both  a
design fault and a bug in  DOS.   COMPACK  sets  the  EXE  driver
header information correctly.  
    Problem Cases                                         #
                          PROBLEM CASES

Not all executable files may be compressed successfully:  COMPACK 
may (see messages) abort compression if:-

     - the .EXE file is an overlay.
     - the .EXE file is a high memory loading program.


    Copyright (C) Prominence Computer Services Ltd. 1990-1993








COMPACK 5.1 User Manual                               Page 10


     - the .COM file is larger than about 65000 bytes.
     - the .EXE file contains overlays or debug information
     - the program is a also a device (eg CACHE.EXE in DRDOS 5).

Executable files should be stripped of any debugging  information
before compression as this  is  not  automatically  removed,  and
cannot be used by  a  debugger  in  compressed  form.   Naturally
inferior compression results by including inaccessible  debugging
information in a compacted file.  COMPACK attempts to detect this 
situation and aborts compaction if the  program  size  is  longer
than specified in the EXE header.  However  compaction  continues
if the -r switch is used.

Programs  which  rely  on  re-reading  themselves  from  disk  or
checking their own size such as COMMAND.COM and certain protected 
software programs may fail to execute correctly when  compressed.
COMPACK cannot always  detect  such  programs  automatically,  so
thorough testing is essential.  Always maintain a backup copy  of
the original program.  COMPACK aborts compression if  COMMAND.COM
is specified as the input program unless the -r switch  is  used.
Using the /P parameter the SHELL command in CONFIG.SYS  can  load
COMMAND.COM permanently in memory so it should never  be  re-read
and therefore works in compacted form.  Unfortunately  this  does
not always  work  with  some  operating  system  and  application
program combinations so again, careful testing is essential.

     Example:-
                     SHELL=C:\COMMAND.COM /P


    Known Anomalies                                       # 
                         KNOWN ANOMALIES

1) COMPACK aborts compaction of an EXE file with more than  12000
relocatable segment references.  Few EXE files are this large.

2) COMPACK does not update the checksum field in the .EXE header. 
This field is not used by DOS, and consequently there  should  be
no ill effects under compatible operating systems.

3)  OS/2  and  Microsoft  (tm)  Windows  format  files  are   not
supported.

4) The BUILDSFX option does not check for duplicate filenames.

5) Some COMPACKted device drivers will not  expand  correctly  if
there is not enough memory.  The same problem occurs with  normal
drivers that require more memory than there image size.


                            Disclaimer

Prominence Computer Services Ltd. hereby disclaims all warranties 
relating to this software, whether express or implied,  including
without limitation any implied warranties of  merchantability  or
fitness for a particular purpose.  Prominence  Computer  Services
Ltd.  will  not  be   liable   for   any   special,   incidental,
consequential,  indirect  or  similar  damages  due  to   program


    Copyright (C) Prominence Computer Services Ltd. 1990-1993








COMPACK 5.1 User Manual                               Page 11


malfunction or any other reason.  In no event shall the liability 
of Prominence Computer Services Ltd. for any damages  exceed  the
price paid for the licence to use the software, regardless of the 
form of the claim.  The person using the software bears all risks 
as to the quality and performance of the software.


COMPACK  has  been  tested  on  many  thousands  of  files   with
successful results.   Nevertheless  the  possibility  of  program
errors can never be completely eliminated.  Testing,  of  course,
is the responsibility of the user.  If  you  have  any  comments,
suggestions or complaints, please contact us.  We will  endeavour
to assist all registered users.  Naturally we intend to  continue
development of COMPACK and feedback from users  is  an  essential
part of this process.  Thank you for your cooperation.













































    Copyright (C) Prominence Computer Services Ltd. 1990-1993








COMPACK 5.1 User Manual                               Page 12


    Answers to some common questions about COMPACK        #
          Answers to some common questions about COMPACK

Q: How is it possible that COMPACK can compress  programs  better
than the best archiving programs?

A: COMPACK understands the  contents  of  program  files  and  is
optimised to compress programs efficiently.  For example  COMPACK
can realise that much of the  space  dedicated  to  an  EXE  file
header is redundant.  General  purpose  archivers  apply  general
purpose algorithms, paying more attention to compression time and 
archive updating at the expense of compressed  archive  size  and
expansion time.


Q: Will a compressed program always behave like the original?

A: Apart from programs which attempt to read themselves, (such as 
COMMAND.COM, overlay programs, programs  with  debug  information
etc.) all programs will run similarly (probably  faster)  because
the expansion code  constructs  an  identical  program  image  in
memory just as if the program had been loaded in memory  by  DOS.
Naturally there has to be a little extra memory for the expansion 
code to run but this is only a few  kbytes.   Unlike  some  other
compressed programs, COMPACKted programs may  be  freely  renamed
because they do not attempt to read themselves.  


Q: However fast the expansion algorithm may be, surely it takes a 
finite amount of time and  therefore  compacted  programs  should
take longer to execute?

A: Almost all compacted programs execute faster  because  smaller
programs load faster.  The  code  expansion  rate  can  typically
exceed 10 Mbits per second on an 80386 and  this  is  far  faster
than the overall throughput of a network or mechanical disk.


Q: How can I be sure that COMPACK will work with  my  application
program?

A: If your application works with any  other  compacter  such  as
Microsoft's EXEPACK, it will almost certainly work  with  COMPACK
but with much better performance.


Q: What programs are  the  best  candidates  for  compression  by
COMPACK?

A:  The  bigger  the  better!   Small  programs  are   compressed
successfully but there will always be fixed overhead  (about  300
bytes) of the expansion code to consider.  This  code  becomes  a
smaller proportion of the whole for large programs.  In  addition
the  compression  itself  becomes  more  efficient   for   larger
programs. 

Q. Much of our distribution software includes data files as  well
as programs.  How can COMPACK be used  to  minimise  distribution


    Copyright (C) Prominence Computer Services Ltd. 1990-1993








COMPACK 5.1 User Manual                               Page 13


media costs?

A. Use COMPACK's -b option to create self extracting files.  

Q. Will my compacted application work on non-standard platforms?

A. Almost certainly.  COMPACTed programs make no extra DOS  calls
and access no DOS nor BIOS memory structures when  expanding  and
so should be compatible even with non DOS operating systems which 
recognise standard EXE  and  COM  programs.    COMPACK  does  not
support Microsoft's Windows format nor other formats  which  will
not run under DOS.  

Q. Why does my compacted application not work?

A.  It  is  possible  your   application   uses   non-initialised
variables.  Check its execution when running in different  memory
configurations, when running under a debugger  etc.   Also  check
there is  enough  RAM  available.   As  a  final  resort  contact
Prominence with sample program.


Q. How much extra memory does a compacted program use?

A. A COM style program uses the full 64K byte segment  regardless
of how big the original file was.  This is a  modest  requirement
as today most PCs come with at least 640 kBytes of RAM.   An  EXE
style program needs  an  extra  0  to  16  kBytes  (3k  bytes  is
typical).  You can find out the exact memory requirements of  EXE
programs using Microsoft's EXEMOD utility.  


Q. Why is it better to prefer COM files over EXE files?

A. COM  files  contain  no  relocation  tables  and  consequently
relocation is not included with the expansion code, so  compacted
COM files are slightly smaller.  Because all COM  files  must  be
smaller than 64 kBytes, the expansion code is faster as it is not 
necessary to cope with multiple segments.


Q. Why does COMPACK think that my COM file is an EXE program (and 
vice versa)?

A. Good question.  An EXE file always starts with  the  signature
bytes "M" "Z" and a COM file does not.  The filename extension is 
ignored by both DOS and COMPACK in determining whether or not the 
program is EXE style.


Q. How much does a licence cost to use COMPACK  on  software  for
corporate distribution?

A. A $125 one time fee permits commercial distribution of  up  to
500 disks per year compacted by COMPACK.  No licencing fee may be 
required for user groups, clubs etc who distribute software on  a
non profit making basis.  Licensing of SFX is negotiable.



    Copyright (C) Prominence Computer Services Ltd. 1990-1993








COMPACK 5.1 User Manual                               Page 14


    Self Extracting Program Creator                       # 
                 Self Extracting Program Creator 

Purpose

The -b option concatenates multiple data files into a single  EXE
style program which re-creates the  data  files  in  the  current
directory when executed.  This  is  a  very  efficient  means  of
distributing all kinds of data  and  program  files.   Benchmarks
show  that  creating  files  in  this  way  is  far  faster  than
conventional self extracting files (up to 20  times  faster)  and
file size is as good as the best archiving programs.  It is often 
faster to execute a SFX file than to use DOS COPY command!   Note
that in this version of COMPACK there is  no  longer  a  separate
BUILDSFX program.


    Syntax                                                #
Syntax

     COMPACK -b [-p] input-file(s) output-program

The  first  parameters   are   one   or   more   ambiguous   file
specifications, (ie they may  optionally  contain  '*',  or  '?')
defining the input files to be included in the program.  The last 
parameter is the name of the output program which is  created  in
COMPACKted EXE format.  Both may contain pathnames.  

COMPACK sometimes creates a temporary file, CPK.$$$, normally  on
the same path as the  output  program.   The  temporary  file  is
deleted afterwards.  You  may wish to  speed  up  compression  or
avoid space problems on  the  output  device  by  specifying  the
directory where the temporary file should be made.  This is  done
by way of the DOS environment variable TMP,  used  also  by  many
other PC applications.  For example if  you  wish  the  temporary
file to written to the RAM disk drive d: one  could  include  the
following DOS command in AUTOEXEC.BAT file.

     SET TMP=D:\  


The optional -p switch indicates that the first  file  is  to  be
extracted as a prompt to the screen when the SFX executes.   This
allows the software distributor to explain to the  user,  in  the
appropriate language, that he  is  executing  a  self  extracting
file.  The prompt file is sent to the  screen  (standard  output)
and the program waits  for  any  key  to  be  pressed  when  file
extraction  commences.   (^C  or  the  BREAK  key   aborts   file
extraction).   You do not need to specify -B if -P is specified. 


    Example Use                                           #
Example Use
     
     COMPACK -B D:\TXT\*.?OC  E:MAKEDOC.EXE
     COMPACK -p PROMPT d:\BIN\*.EXE d:\BIN\*.COM EXESFX.EXE

    Execution of the SFX                                  #


    Copyright (C) Prominence Computer Services Ltd. 1990-1993








COMPACK 5.1 User Manual                               Page 15


Execution of the SFX

When executed the SFX.EXE program will expand  itself  in  memory
and create its component data files (overwriting any  files  with
the same name) in the current directory.  Obviously there must be 
enough free memory available for SFX to run  so  care  should  be
taken not to create excessively large SFX programs.  If necessary 
multiple SFX programs.

The  SFX  returns  an  error  code  of  0  if  file  creation  is
successful, otherwise a simple message  is  displayed  and  error
code > 0 is returned.  These error codes can  be  detected  by  a
batch file or install program.  

Component files are created with their  original  attributes  and
date and time stamps.


    Using SFX programs on Single Diskette Systems         #
Using SFX programs on Single Diskette Systems

One of the most frustrating problems using conventional  archives
is the need to access  the  archive  file,  the  archive  utility
program and an empty destination diskette simultaneously.  Single 
diskette systems may require laborious and error  prone  multiple
diskette changes.  Because the SFX programs created by COMPACK do 
not read themselves from  disk,  once  loaded  into  memory,  the
source diskette is no longer required.  Software distributors may 
wish to advise their users that it is safe to change diskettes by 
inserting the appropriate message in the optional prompt file.

Naturally if it is intended that extraction  is  to  be  made  to
diskette, there must be enough free space on  that  diskette  for
all the extracted files!  (A generic warning message is given  if
there is not).  To avoid potential errors of this kind it is wise 
to limit the volume of files compressed into any one SFX program. 
In any case sufficient memory must be available to hold  all  the
expanded files in memory.  If insufficient  memory  is  available
the operating system will abort loading of the SFX program.   


  Minimising SFX Disk Size                               # 
Minimising SFX disk size

COMPACK works by compressing repeated byte strings so files which 
are likely to contain similar strings should be grouped  together
in the SFX.  This can be done by  reordering  the  files  in  the
input directory.  For example, it is often  appropriate  to  sort
the input directory first by  filename  extension,  and  then  by
increasing file size.  



  Acknowledgements                                        #
                         Acknowledgements

We would like to thank Mitugo Kurizono  for  placing  the  source
code of UNLZEXE.C in the public domain.    Some  of  his  UNLZEXE


    Copyright (C) Prominence Computer Services Ltd. 1990-1993








COMPACK 5.1 User Manual                               Page 16


routines have been significantly optimized and incorporated  into
COMPACK.


























































    Copyright (C) Prominence Computer Services Ltd. 1990-1993





