                       The Make UPGRADE program
                             Version 1.00
                   The author: Alexander Cherepnew
                 () By Alexander Cherepnew 1997-1999

                           1. Introduction
              2. Principle of operation of the program.
     With creation of backup copies for example databases,  in archive
get as not varying files (For Example if at them has appeared reset(or
placed) attribute "Archive") and very poorly varying files (For Examp-
le in base changed one record). Naturally under such circumstances si-
zes  of  archive  fast grow,  and in due course surpass the sizes of a
free space.  Then before the manager there is a question:  What to do?
To  delete - and suddenly it will be necessary?  With packing (to pack
with what or archiver)?  It is possible certainly packing,  but modern
archivers is rather ineffective process such archives.  And in the to-
tal all the same it is necessary to delete...

          It is possible how to bypass? Now it is possible!

     The given program in it to you will help. The principle of opera-
tion of the program is rather simplis. Two files undertake: one - pre-
vious  version  (for  example yesterday's),  second - new version (to-
day's),  and the program comparing two files (binary) and takes out in
the UPG-file only references to data of the previous file + new infor-
mation. In the total is received, that having the old file (for examp-
le first in a of chain changed files) and this information is possible
to restore the new file. Such formula turns out:

   Ŀ   Ŀ   Ŀ
    The old file  +  The UPG-file  =  The new file 
         

     It is necessary to notice that the size of the UPG-file much less
new file (and archive anyone distributed arhiver,  containing the  new
file).  Usually prize in space makes up to 500 % (in case of the data-
base by the size about 6 megabytes with daily backup copying) in  com-
parison with archive ARJ.

                     Impresses? But it yet all!!!

     The program in a state to process binary files (for example  EXE)
nearly  it  is worse than files of databases.  The prize in density of
packing here depends on an amount of changes brought  in  in  the  new
version  of the file,  but the program is usual works not worse anyone
archiver.  If it is not enough of changes, percent of packing jumps up
up, if much - falls. In a case if to pack the file it fails, the prog-
ram simple copies it in archive,  but such happens seldom.  If for the
file there is no previous version, program simple copying it in archi-
ve.

                  Well how? But also that yet all!!!
     The matter as that the program does not use any of the widespread
methods of usual packing.  What for to me it,  if other programs do it
and so not bad...  But it moreover prize in space.  The matter in that
that  the UPG-file itself is not bad packed (50%  ordinal size),  that
gives a cumulative prize in density of packing somewhere in  16  times
in comparison with use of usual archivers.

     Now is more serious.  The program in a state to detect in two fi-
les identical byte sequences long more than 14 bytes.  The  limitation
on  minimum  length is stipulated by the size of data of the reference
written in the UPG-file.  And the sequences long from 14 bytes and are
higher  the  program searches in small files.  The rise of a file size
results in increase of length detected  sequence.  In  a  common  case
(with installations accepted in the program by default) length is gua-
ranteed of a detected sequence makes 0,0125 % from are long of the fi-
le.  You can reduce length of a minimum sequence byte by specifying in
the command line of the program an option /CRP,  however I do not  re-
commend it to do.  The prize from it turns out small,  and the program
works much slower.

                    3.  Limitation of the program.

     The given program is efficient with start from  the  DOS  command
line of version 6.XX and is higher (switching Windows 3.XX and is hig-
her).  The computer with the processor 486 and above is necessary  for
correct operation of the program. The program was tested on Intel pro-
cessors 486,  Pentium,  Celeron and Pentium II.  On processors AMD and
other program was not tested, but should work normaly.
     The program provides compression of files in a case if total size
of  the  old  and new version of the file less size of the main memory
(free).
ͻ
 Refer the file mupg101.txt for information about new posibilites.  
ͼ
                             4.  Command

     In the present version 4 commands for operation with the  program
are supported. The description of each of them further will be given:

               4.1.  A  -  to create the new UPG-file.

     With use  of  the  given  command  there is a creation of the new
UPG-file.  In the command line 3 parameters should be  indicated  (not
considering  unessential  options).

     First underline  a  name  of the UPG-file (it is possible without
the extension). By default the UPG-file is created in the current sub-
directory. If necessary you can except a file name specify and path to
the subdirectory,  where the file should be created. This subdirectory
should  exist  on a moment of start of the program,  differently there
will be an abort of the program with output of the appropriate  messa-
ge. If the indicated UPG-file already exists, the program will request
confirmations on it deleting.  In a case if you will not confirm dele-
ting the file, the program will abort the operation.

     The second  and  third  parameters  should specify subdirectories
containing old and new versions of files accordingly (the second para-
meter - the subdirectory with old files, third - with new).

ͻ
      Masks      of      substitution      NOT      ALLOWED!!!      
ͼ

     You can specify subdirectories both from a current position,  and
from the radical of the disk.  With use of the given command the prog-
ram  processes  ALL files,  which are in the subdirectory indicated by
the third parameter.  Therefore be cautious and do not leave there su-
perfluous files.

             4.2.  L - to show contents of the UPG-file.

     On this  command  on  the screen the list of files is output,  on
which upgrade the indicated UPG-file is calculated.  One parameter in-
dicating  a  name  of the UPG-file for review (is possible without the
extension) is necessary for the given command.  The file, indicated by
this parameter,  should exist. The information on files, on which upg-
rade the archive is calculated is output on the screen as the table:

Ŀ
                    Old File                 New File           Packed 
    Name    Ĵ   Size  
               Size    Date   Time    Size    Date   Time          
Ĵ
TESTING.ARJ    57745716-08-98 11:47   57745716-08-98 11:47       57
TESTING.TXT      404816-02-99 23:00        0 3-09-98 21:03       76
TESTING.EXE         0 0-00-00  0:00    2795222-11-97 21:34    28028
TESTING.ZIP    16656510-08-98 21:14   16656510-08-98 21:29     3516
Ĵ
 Totaly:       748070      3 file(s)   771974      4 file(s)    31677


     So, as we see in the first column the name of the file (in a for-
mat DOS) is output.  Following 3 columns show the size,  date, time of
the old file,  which is necessary for creation of the  new  file.  The
following  three  columns  give the same information for the new file.
Also completes matter a column of the size of packed  data  concerning
the given file.

     At the end of the table the total line is output,  from which you
can find out the size and amount both "old" and "new" files,  and also
size of packed data.
ͻ
  Refer the file mupg101.txt for information about new option /LT   
ͼ
                             4.3 H - Help

     The given  command outputs on the screen the brief information on
commands and options of the program.  Any options and consequent para-
meters of the command line are ignored.

                      4.4 X - Unpacking of files

     The given command provides unpacking files contained in the indi-
cated UPG-file.  The given command requires the indication in the com-
mand line of three parameters: The first parameter specifies a name of
the UPG-file (it is possible without the extension). The indicated fi-
le should exist, and to be the correct UPG-file. In case of absence of
the file to the indicated name, or with it damage there is an abort of
the program with output of the appropriate message.

     The second  parameter  specifies  the subdirectory containing old
files (which is necessary to update).  The indicated subdirectory sho-
uld exist,  and should contain all necessary files. The list of files,
necessary for upgrade, can be received through the command L.

     The third parameter should specify the subdirectory, in which the
new versions of files (after upgrade) should be written down.  The in-
dicated subdirectory should exist.  You can also specify the same sub-
directory, as indicated in the second parameter of the command In this
Case updated files will be written in the  subdirectory,  erasing  old
versions of files.  However I very much do not recommend this possibi-
lity. You see in case of what or error (for example instead of the fi-
le  of  the  version  from April 12 in the subdirectory the older file
from the last year has got,  in this case program  will  complete  the
operation of failures but,  by informing about mismatch of versions of
files.  And those files which the program already has updated will  be
unsuitable  with the following start of the program (they already new)
and the program will be under abnormal condition completed by specify-
ing  improper  old  names of files).

     In a  case  if  in  the  UPG-file the structure of directories is
written down,  you should be sure,  that the necessary files (old) are
present at necessary subdirectories which are taking place in the sub-
directory indicated second parameter. In the target subdirectory (whe-
re the new versions of files) required structure of subdirectories are
written can be absent.  In this case program  will  restore  from  the
UPG-file required structure of subdirectories,  requesting the consent
of the user to creation of each subdirectory.

     All options,  except selection of the virtual storage and options
of copying (deleting) are ignored.  If the UPG-file contains the addi-
tional text information,  it is output on the screen before the begin-
ning of unpacking.

              4.5. T - Check of correspondence of files.

     The T  command  is for check of a correctness of the subdirectory
containing "old" files,  for upgrade with the help of the given  prog-
ram.  With the definition of the given command it is necessary to spe-
cify a name of the UPG-file and name of  the  subdirectory  containing
"old" files.  Both UPG-file and subdirectory should exist. The program
executing the given command checks correspondence of  "old"  files  to
records about them in the UPG-file.

     For each file the result of check is output. In a case if the fi-
le corresponds to all requirements of the UPG-file,  opposite  to  its
name the program will put "Ok"!.

     In a  case if the size or check sum of the file there do not cor-
respond records in the UPG-file,  or file is absent,  the program will
inform you about it.

     In some cases the "old" version is not necessary it for restoring
the file.  In this case program opposite to such file will write  "Not
need".  That means, that with upgrade of files the old version of this
file to be used will not be.

     I recommend before unpacking of the UPG-file to check up  a  cor-
rectness  of  the subdirectory containing old versions of files,  with
the help of the given command.  It will allow to avoid output  of  the
messages about mismatch of versions of files during unpacking.

ͻ
  Please refer the mupg101.txt tor information about new command M  
ͼ

                       5. Option of the program

     The given  program  allows to use some options allowing more fle-
xible to operate by creation of the UPG-file. The description of these
options is resulted below:

            5.1 /V:XXX - selection of the virtual storage.
ͻ
             This option not supported in version 1.01              
ͼ

   5.2. /I:NNNNNN - Connection of the additional text information.

     The program  allows  in the UPG-file to add the text information,
is output on the screen with call to the UPG-file with the purpose  of
unpacking or review of the list of files (commands X and L).

     With use  of  the  given  option  you should prepare a text file,
which will be output on the screen. Use ANSI of sequences by the prog-
ram is not supported,  however you can them use, if are sure that with
unpacking UPG of the file the ANSI driver will be loaded. Maximum file
size with the additional information - 64 Kilobytes.

     With the  instruction  of  the given option specify a name of the
prepared text file and it will  be  connected  to  the  UPG-file.  For
example option /I:TEXT.TXT connects to archive the TEXT.TXT file.  The
remark: the given option can be used only with creation of the UPG-fi-
le by the A command. In any other cases she is ignored.

             5.3 /CRP:XXX - Setup of a compression level.


In the majority of the widespread programs - archivers there are  com-
mands  for  handle  of  "power" of packing.  They are necessary there,
whether or not - theme for other talk.  And me,  following  the  usual
tradition it was necessary to include in programs (in passing essenti-
ally by complicating algorithm) an option of installation  of  "power"
of packing. In this option you can specify percent of "power" of algo-
rithm from the greatest possible value,  which accordingly changes de-
pending on a file size and memory size.

     This option  is based on change of minimum guaranteed length of a
detected site of the new file.  With application of the  given  option
you  can forget about the formula of account of this metric above men-
tioned. In a case if you as the parameter of an option will enter 100%
(/CRP:100) that program uses under search tables ALL stayed memory af-
ter loading the old and new file,  by leaving a small piece for  other
needs.  It  is necessary to tell that the left piece of memory can not
suffice, that can result to a program termination. It theoretically is
possible, but in practice I with it never met.

     Follows as to notice,  that the installation of the greatest pos-
sible packing,  will reduce the resulting file rather unsignificantly.
The  reason  that with such option the program will detect in the file
conterminous sequences smaller are long,  that unambiguously will inc-
rease  their  amount.  Turns  out that in this case in the UPG-file is
written less new data,  but there are more references to the  previous
file.  The resulting file will be less, but not on many, and the prog-
ram will work much longer (with packing. With unpacking the difference
between  two files will be minimum).  It is necessary to notice,  that
the parameter of an option transfers PERCENT. And consequently you can
specify any number from 1 up to 100.

     And last  remark.  If  you will specify in this option percent of
packing less used by default,  the program will  ignore  this  option.
That is to set percent of packing it is less used by default it is im-
possible.

ͻ
     Please refer file mupg101.txt for remark about this option     
ͼ

          5.4. /SE - to create the selfextracting UPG-file.

     This option allows to create the self-extracting  UPG-file.  Thus
to the UPG-file the standalone unpacker calculated on operation in re-
al mode of the processor is assigned.

     The unpacker occupies about 12 kilobytes and  supports  unpacking
files, output of help on commands of a unpacker, output of the list of
files (is similar to the command L).  Any additional files are not ne-
cessary  for  operation of a standalone unpacker.  The given option is
supported only together with the A command (creation UPG of the file).
Only with this option the extension of the UPG-file by default is ins-
talled in .EXE. The size of the selfextracting UPG-file is limited on-
ly to size of the hard disk.

     It is necessary to tell, that the speed of unpacking at a standa-
lone unpacker is little bit lower than at the MUPGRADE program.  It is
caused  by  that  all operations on unpacking at a standalone unpacker
are made with the disk, whereas all operations on unpacking at MUPGRA-
DE occur in the main memory.

ͻ
 Please refer file mupg101.txt for information about new option /ST 
ͼ

               5.5. /NE - to not include varying files.

     With use of the given option the not varying files are eliminated
from archive.  It reduces the size of the UPG-file at the  expense  of
deleting  from  him  of the information on not varying files a little.
However to restore created with the  help  of  the  given  option  the
UPG-file  it is necessary preliminary copying of old files in the sub-
directory of new files (subdirectories of old and new files should  be
identical).

     The option is meaningful only with use with the A command. In all
other cases she is ignored.

                           5.6 /C - to copy

     The given option defines copying files from the  subdirectory  of
"new" files in the subdirectory of "old" files. The operation of copy-
ing is executed after completion of current operation. This option (as
well as options of clearing of subdirectories) is intended for automa-
tion of creation of regular copies of databases.  The option is shared
with commands of creation of the UPG-file and it of unpacking (A and X
accordingly).  In case of other commands is ignored.  With  processing
this  option  their  is copied all files and structure of directories,
containing.

        5.7 /DT and /DS - to delete all files and directories.

     With use of these options there is deleting all files and  direc-
tories from a directory "new" (/DS) or "old" (/DT) of files. These op-
tions are processed only together with an option /C.  And the deleting
of  "new" files occurs AFTER their copying,  and the clearing of a di-
rectory of old files occurs BEFORE copying. These options also are in-
tended for automation of operation with regular backup copies of data-
bases.

          5.8 /Y - to answer "Yes" questions of the program.

     With operation of the program she sometimes can set to  the  user
some questions. For example: "File NNNNNNNN.EEE already exists. Owerw-
rite?".  Or about that whether to erase all files in a  directory.  In
case of single use of the program it is not terrible. However when the
program is used constantly for solution of the same tasks (for example
for backup copying of databases) - these questions become superfluous.
This option will allow you to specify about what to the program it  is
not  necessary  to request the user.  The code of questions the follo-
wing:

ͻ
 The code  Question of the program                                 
Ķ
    C      The subdirectory is not found. To create?               
Ķ
    T      To delete all files from the dest subdirectory? (before 
           copying)                                                
Ķ
    S      To delete all files from the subdirectory - source?     
           (after copying).                                        
Ķ
    O      The file already exists. To rewrite?                    
ͼ

     To use this possibility it is simplis. For it in the command line
the  list  of codes of questions is indicated an option /Y and at once
after it(her),  which the program should automatically  answer  "Yes".
For example:  /YCO means that the program automatically (not expecting
response of the user) will create the necessary subdirectories and  to
rewrite existing files.

     Pay attention,  that questions,  which codes are not described in
the given option the program will set to the user.  For example if the
variant of an option /YCO was used, questions T and S the program will
set to the user and will wait for it of response,  and the program au-
tomatically will answer questions C and O "Yes".

     The note:  Through  the given option it is impossible to bypass a
question of the program on a disadvantage of resources of the computer
for the requested power of packing.  The reason in that that the obvi-
ous definition of power of packing is intended for single  use,  while
the given option is intended for automation of routine operations.
ͻ
 Please refer file mupg101.txt for information about new option /LT 
ͼ
          6. Error and recommendation for their elimination.

     In the  given  section all messages on errors are given which can
produce my code. For each message the recommendations are given...

              'Unknown error! Please report to author.'
     The most  unpleasant error.  I hope she at you never will appear,
but if has appeared, inform about her me. (see section Contacts)

                   'Wrong percent in option /CRP',
     The given  message  speaks that the program cannot correct decode
percent of power of packing in the command line. Check up your command
line and try once again.

                    'Wrong count in option /CRC',
     The incorrect number is indicated in an option of a command line.
Check up it and try once again.

                'Unknown parameter in command line.',
                         'Unknown command.',
                          'Unknown option.',
     These messages speak about that that the program has detected  in
the command line the unknown parameter or option. Check up the command
line of the program.

                          ' Noting to do. ',
     It not the error, and is simplis the message that the program has
nothing to do. That is directory, which should contain new versions of
files is empty (that is has not any file). Check up the instruction of
a directory in the command line.

                         ' Out of memory. ',
     It is unpleasant the message speaks that the memory does not suf-
fice for execution of operation.  The operation naturally  interrupts.
Try  to create the virtual storage (Option /V).  Or do not use options
of installation of power of packing. Or increase the RAM.

                    'Can not create files list.',
     This message  speaks  that  the  program did not manage to create
sleep juice of all files for packing.  The reasons it can be most dif-
ferent.  A disadvantage of memory,  too deep structure of directories,
too plenty of files.  Try to divide one task on little bit more  simp-
lis. For example to pack files in parts. Reduce an enclosure of subdi-
rectories. Check up a correctness of structure of directories.

                     'Can not create UPG-file:',
     Error with creation of the UPG-file. Probably you do not have the
rights to creation of files in this directory, or the diskette is pro-
tected from record, or the disk is full.

                 'Additional information too large.',
     At the given program the size of the additional information about
archive is limited to 64 kilobytes,  and in an option /I you have spe-
cified the file,  which size surpasses an indicated limit.  Reduce the
file with the additional information.

                            'Read error.',
     Read error. Probably physical and logical defect of the medium.

                           'Write error.',
     Error of record. Probably physical or logical defect of the medi-
um, or medium is full.

           'Can not find file with additional information',
     The file indicated in the command line as the file of the additi-
onal information to archive,  is not found.  Check up the command line
on a correctness of the instruction of a file name. In an extreme case
specify FULL a name of the file including the disk, subdirectories and
name of the file.

                   ' File of % is not UPG-file. ',
     The file indicated in the message is not the UPG-file.  I sympat-
hize...

         'CRC of file of % not equal with UPG file record.',
         'Size of file of % not equal with UPG file record.',
     With unpacking it is revealed,  that the file (is more exact than
it the old version) does not coincide that was used with  packing.  In
this case unpacking (correct) is improbable. Find that file, which was
used with packing. The commands L and T will help to you in it.

                       ' Not find file of % ',
     The file necessary for unpacking (old version)  is  absent.  Find
the file indicated in the message...

                          ' Expand error. ',
     Error of unpacking. Most likely you have encountered on extremely
seldom a situation when also size and CRC of  the  old  file  coincide
with written down in UPG the file, but file is changed from the moment
of use with packing.  And it was revealed,  when the file was unpacked
and was calculated it of CRC. Look for the file...

