home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mdf160.zip / MDF_ENG.TXT < prev    next >
Text File  |  1997-01-11  |  16KB  |  411 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.                                   MDIFF  -  MPATCH
  12.                                     Release  1.60
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.       Simple but complete program to produce and apply patches to your programs
  27.                and data files for Dos, OS/2, Windows95 and WindowsNT.
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.                                    English manual
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.                   (C) 1997/98 Maurizio Giunti - All rights reserved
  52.  
  53.  
  54.  
  55.  
  56.  
  57.      1.INDEX
  58.  
  59.  
  60.      1.INDEX                                                                  2
  61.  
  62.  
  63.      2.DISCLAIMER OF WARRANTY                                                 3
  64.  
  65.  
  66.      3.DISTRIBUTION AND USE                                                   3
  67.  
  68.  
  69.      4.WHY?                                                                   3
  70.  
  71.  
  72.      5.WHAT MDIFF-MPATCH DO?                                                  3
  73.  
  74.  
  75.      6.EXAMPLE                                                                3
  76.  
  77.  
  78.      7.DOS, OS/2, WINDOWS 95 AND WINDOWS NT                                   4
  79.  
  80.  
  81.      8.LIMITS AND KNOWN BUGS                                                  4
  82.  
  83.  
  84.      9.MDIFF - MDIFF2 - MDIFFW                                                4
  85.  
  86.  
  87.      10.MPATCH - MPATCH2 - MPATCHW                                            5
  88.  
  89.  
  90.      11.MDF2EXE - MDF2EXE2 - MDF2EXEW                                         6
  91.  
  92.  
  93.      12.SUGGESTIONS                                                           6
  94.  
  95.  
  96.      13.LIBRARIES TO APPLY PATCHES                                            6
  97.  
  98.  
  99.      14.REGISTERING MDIFF                                                     6
  100.  
  101.  
  102.      15.HOW TO CONTACT THE AUTHOR                                             7
  103.  
  104.  
  105.      16.ACKNOWLEDGEMENTS                                                      7
  106.  
  107.  
  108.  
  109.  
  110.  
  111.                                                                               2
  112.  
  113.  
  114.  
  115.  
  116.  
  117.      2.DISCLAIMER OF WARRANTY
  118.      THIS  SOFTWARE AND THE  ACCOMPANYING FILES  ARE SOLD "AS  IS" AND  WITHOUT
  119.      WARRANTIES  AS TO PERFORMANCE OF  MERCHANTABILITY OR ANY OTHER  WARRANTIES
  120.      WHETHER EXPRESSED OR IMPLIED.
  121.      The  only warranty that comes  with this software is  that it will  occupy
  122.      disk  space. I absolutely can NOT warrant that it will perfectly work,  or
  123.      that it will be your problems' solution.
  124.      Nevertheless,  it is not a virus and does not contain (unless infected  or
  125.      modified  after the   compilation)  Trojan-horses, backdoors  and  similar
  126.      tricky  garbage. In  any case,  the author  is not  responsible   for  any
  127.      damage, moral or material, direct or indirect, derived from its use.
  128.  
  129.      3.DISTRIBUTION AND USE
  130.      This software belongs to Shareware programs: anyone can  freely distribute
  131.      and use  it for a trial period of 15 days.  After this period,  users that
  132.      continue  to use it must register their  copy by sending the  registration
  133.      fee to the  author, Maurizio Giunti.
  134.      The  registered users  will receive  a "registration  key" which  contains
  135.      their name (or their firm/organisation name for site-licenses).
  136.      This  software can be freely distributed at  no cost, except for  eventual
  137.      copy and/or shipping expenses.
  138.      It  is imperative anyway that the  ORIGINAL PACKET is distributed  without
  139.      any modification WHATSOEVER.
  140.      There  is an exception: you can distribute MPATCH.EXE, MPATCH2.EXE  and/or
  141.      MPATCHW.EXE  with one or more *.MDF files produced with a REGISTERED  copy
  142.      of  MDIFF. Moreover  you can  distribute any executable  file produced  by
  143.      MDF2EXE.EXE,  MDF2EXE2.EXE  and  MDF2EXEW.EXE  which  contains   ONLY  MDF
  144.      patches built by a registered copy of MDIFF.
  145.      About *.MDF patches the author of this program does not claim rights.
  146.  
  147.      4.WHY?
  148.      A  few months ago I was updating  a program of mine: since the  compressed
  149.      packet  was about 200 Kbytes, I thought it was better to use a  patch, but
  150.      I   could  not  find  a  program  of  my  satisfaction  among  the   patch
  151.      makers/appliers.  In addition I could not trace  a program that could  run
  152.      under DOS and OS/2.
  153.      I decided to make my own patch software and.....here it is ! 8-)
  154.  
  155.      5.WHAT MDIFF-MPATCH DO?
  156.      MDIFF  creates a binary difference between two files. With MPATCH and  the
  157.      older  file you can create a new  file using the difference file. What  is
  158.      the  advantage? Usually the difference file is smaller and therefore  more
  159.      suitable for distribution, especially by modem.
  160.  
  161.      6.EXAMPLE
  162.      As  an example I put  in two directories named  OLD and NEW,  respectively
  163.      MDIFF.EXE  release 1.45a (a work in progress alpha release) and  MDIFF.EXE
  164.      release 1.45:
  165.  
  166.      Directory of  OLD\*.EXE
  167.      MDIFF.EXE       46602  16/08/95   21.01
  168.  
  169.      Directory of  NEW\*.EXE
  170.      MDIFF.EXE       46602   21/08/95  00.45
  171.                                                                               3
  172.  
  173.  
  174.  
  175.  
  176.  
  177.      C:\>mdiff OLD\MDIFF.EXE NEW\MDIFF.EXE
  178.      MDIFF  V1.50 - MDF file generator (Dos)
  179.      (C) Copyright 1995/96 Maurizio Giunti
  180.  
  181.      Registered to: MAURIZIO GIUNTI
  182.  
  183.      OLD\MDIFF.EXE,NEW\MDIFF.EXE => MDIFF.MDF
  184.      Working...(100%)   MDF size: 1215 bytes   Rate: 2%
  185.      <Done!>
  186.  
  187.      Directory of  *.MDF
  188.      MDIFF.MDF        1215   7/10/95  13.43
  189.  
  190.      Now,  we can apply the  patch named MDIFF.MDF to  the old file to  rebuild
  191.      the new one:
  192.  
  193.      C:\>mpatch MDIFF.MDF old\MDIFF.EXE
  194.      MPATCH  V1.50 - MDF file applier (Dos)
  195.      (C) Copyright 1995/96 Maurizio Giunti
  196.  
  197.      MDF file produced by: MAURIZIO GIUNTI
  198.  
  199.      Working: 0% |###########| 100%
  200.      <Done!>
  201.  
  202.      I obtain the following file:
  203.  
  204.      Directory of  *.EXE
  205.      MDIFF.EXE       46602  21/08/95   0.41
  206.  
  207.      which is BINARY EQUAL to the new file.
  208.  
  209.      7.DOS, OS/2, WINDOWS 95 AND WINDOWS NT
  210.      I usually build MDIFF and MPATCH for Dos, OS/2 and Windows32  by compiling
  211.      the  same  source,  so  there is  NO  difference  between  them.  Moreover
  212.      difference files produced with MDIFF for Dos can be used with   MPATCH for
  213.      OS/2 or Windows32 and viceversa.
  214.  
  215.      8.LIMITS AND KNOWN BUGS
  216.      MDIFF  can't work on  files greater than  16 Mbytes and  it can't  process
  217.      files smaller than 20 times the current chunk length.
  218.      Since  its source is  the same as  Dos' MDIFF, OS/2's  MDIFF can't  manage
  219.      Extended Attributes: it will ignore them.
  220.      Moreover  if you build a patch by MDIFF for Dos or OS/2, when  applying it
  221.      by  MPATCH for Windows32 and viceversa if  you build a patch by MDIFF  for
  222.      Windows32 and apply it by MPATCH for Dos or OS/2, you will obtain  a wrong
  223.      date  and  time  on the  new  file.  This bug  depends  from  a  different
  224.      implementation   of  the  utime()  function   in  Borland  and   Microsoft
  225.      compilers.
  226.  
  227.      9.MDIFF - MDIFF2 - MDIFFW
  228.      MDIFF  compares 2  files  and stores  the differences  between them  in  a
  229.      difference file. This is the command line  syntax:
  230.  
  231.                                                                               4
  232.  
  233.  
  234.  
  235.  
  236.         MDIFF [-C<c>] [-R<r>] [-F<f>] [-S] [-Z] [-P<pwd>] <OldFile> <NewFile>
  237.                                      [<MDFfile>]
  238.  
  239.      <OldFile> is the name of the older file, <NewFile> is the name of  the new
  240.      file.  If you wish you can specify the   name of the difference file  that
  241.      MDIFF  will produce, otherwise MDIFF will create  a file with the name  of
  242.      the  new file but with the extension ".MDF".
  243.      To  search differences between files, MDIFF uses a base string of  defined
  244.      length named Chunk. The Chunk length is  by default  automatically chosed,
  245.      but  you can set it, in the range  4-1024, with the -C switch followed  by
  246.      the desired length.
  247.      When MDIFF loses the synchronism between the two files being  compared, it
  248.      scans  the older  file  searching the   current  chunk. This  scansion  is
  249.      executed,  by default, in a range of 8  blocks of 512 bytes each. You  can
  250.      change  the number of the blocks scanned,  in the range 1-16, with the  -R
  251.      switch followed by the desired number of  blocks.
  252.      If  this search  fails, MDIFF  tries to  force synchronisation  through  a
  253.      large range search. This range is defined as 1/16 of the old  file length,
  254.      but you can change it by the -F switch on the command line.
  255.      If  you specify -S switch, MDIFF will  provide some information about  the
  256.      composition of the difference file.
  257.      Moreover  you can  add to  the difference  file produced  a short  comment
  258.      (max. 2 Kbytes) to display when the patch is applied, with the  -Z switch.
  259.      MDIFF  gets the comment from standard input,  so you can type it  directly
  260.      or redirect it from a file with the "<" command.
  261.      You can also protect the patch by a password using the -P  switch followed
  262.      by the password. Please notice that the password field is case sensitive.
  263.  
  264.      10.MPATCH - MPATCH2 - MPATCHW
  265.      With  the old  file and  the .MDF file  you can  rebuild the  new file  by
  266.      running MPATCH. This is the command line  syntax:
  267.  
  268.                  MPATCH [-P<pwd>] <MDFfile> [<OldFile> [<NewFile>]]
  269.  
  270.      MPATCH  needs  only  the name  of  the  MDF file  (<MDFfile>)  because  it
  271.      contains  the names of the other 2  files, but  it's possible to  override
  272.      these  names specifying the desired names on the command line. MPATCH  has
  273.      only the -P switch by which you can specify a password.
  274.      If  there  are  errors  during  the  patch  applying,  MPATCH  returns  an
  275.      errorlevel as follows:
  276.      0        "OK!"
  277.      1        "Out of memory !"
  278.      2        "Can't open MDF file !"
  279.      3        "Invalid MDF file !"
  280.      4        "MDF file version mismatch !"
  281.      5        "UNREGISTERED !"
  282.      6        "Bad or incorrect OLD file !"
  283.      7        "Can't open OLD file !"
  284.      8        "Can't create NEW file !"
  285.      9        "General failure: NEW file corrupted !"
  286.      10       "OLD and NEW can't be the same file !"
  287.      11       "NEW file was already patched !"
  288.      12       "Wrong password !"
  289.  
  290.  
  291.                                                                               5
  292.  
  293.  
  294.  
  295.  
  296.      11.MDF2EXE - MDF2EXE2 - MDF2EXEW
  297.      MDF2EXE  is a simple  utility which  stores one  or more (up  to 127)  MDF
  298.      patch  files created by MDIFF, to an executable (Dos, OS/2 or  Windows32).
  299.      This kind of executable is called  self installing patch.
  300.      MDF2EXE syntax is:
  301.  
  302.            MDF2EXE <mdf_file 1> [<mdf_file 2>....<mdf_file n>] <exe_file>
  303.  
  304.      Where <mdf_file x> can contain wildcards.
  305.      The  <exe_file> (which MUST have .EXE extension) will be executed  without
  306.      any  parameters on  the command  line. It  will automatically  search  the
  307.      files to update.
  308.      Eventually you  can use a -P switch to specify a password or the -V  or -L
  309.      switches to list the patches stored in the file.
  310.      Warning:  don't compress a  self installing  patch by PKLite  or LZexe  or
  311.      other similar compression/encryption tools.
  312.  
  313.      12.SUGGESTIONS
  314.      The  best method to build  a difference file, is  to search the chunks  of
  315.      the  new file in the entire older  file, but this  is  a very slow way  to
  316.      do! MDIFF's algorithm tries to give a small diff file in a faster  way; so
  317.      you  are sometimes required to tune the work  parameters with the  command
  318.      line switches.
  319.      Let's look at some typical situations:
  320.      1.        Very  similar files: use a  large chunk (32, 64  or more) to reduce  the
  321.        size  of the  diff file,  in particular  if the  files contain  text  or
  322.        archives.
  323.      2.        Text  files: try to use a  chunk size of 32,  sometimes it is better  to
  324.        turn the forced sync off or reduce its range by the -F switch.
  325.      3.        Very  large executable: try to use a  larger resync range (16 or  more),
  326.        with the -R switch.
  327.      Remember:  MDIFF  can't  make  miracles!  If  the  two  files  are  really
  328.      different,  the patch will result very large.  In this situation you  must
  329.      distribute  the entire new file. MDIFF is  useful only when the amount  of
  330.      changes is limited.
  331.  
  332.      13.LIBRARIES TO APPLY PATCHES
  333.      Up  to release 1.50 a  set of libraries was  included in the  distribution
  334.      packet.  These libraries are no more distributed but now you can  purchase
  335.      (see  chapter 14) a C  source you can use  as a sample  to build your  own
  336.      patch  applying software. The C  sample can only apply  patches made by  a
  337.      registered copy of MDIFF.
  338.  
  339.      14.REGISTERING MDIFF
  340.      By  registering MDIFF you  will obtain a  REGISTRATION KEY which  contains
  341.      your name (or your firm/organisation for site-licenses). When  you produce
  342.      a patch by a registered MDIFF, it will store your name in the  patch. When
  343.      MPATCH will install your patches it will display your name.
  344.      Moreover   any  registered  user  has  permission  to  freely   distribute
  345.      MPATCH.EXE, MPATCH2.EXE and MPATCHW.EXE with any MDF file prepared  by the
  346.      user.  Any self-installing patches produced by the registered user can  be
  347.      freely distributed and used.
  348.      No royalty or extra charge required!
  349.      Included  in MDIFF  packet you  will find a  Windows registration  program
  350.      named REGISTER.EXE. Please run it on Windows environment.
  351.                                                                               6
  352.  
  353.  
  354.  
  355.  
  356.      REGISTER.EXE  is a small  Windows application written  by Grzegorz  (Greg)
  357.      Kochaniak, which provides all info needed to purchase MDIFF and  it allows
  358.      you to send them directly to Kagi Shareware service by snail  mail, e-mail
  359.      or fax. If you do not use Windows please contact me.
  360.      For any info about Kagi Shareware please read KAGI.TXT file or go to the
  361.      URL:
  362.                                 http://www.kagi.com/
  363.  
  364.      15.HOW TO CONTACT THE AUTHOR
  365.      For  any  problem  or  question  you  can  contact  me  at  the  following
  366.      addresses:
  367.  
  368.      snail mail:
  369.                      Maurizio Giunti
  370.                      Via G.B. Foggini, 24
  371.                      50142 Firenze (FI)
  372.                      ITALY
  373.  
  374.      e-mail:
  375.                      Fidonet:      2:332/102.3
  376.                      Internet:     giunti@kagi.com
  377.                      URL:          http://www.kagi.com/authors/giunti/
  378.  
  379.      16.ACKNOWLEDGEMENTS
  380.      I'd  like to thank all  those who helped me  to develop this software  and
  381.      its  documentation  and all  those  who   helped  me in  beta-testing.  In
  382.      alphabetical order:
  383.  
  384.                              Mauricio Mello de Andreade
  385.  
  386.                                    Andrea Baitelli
  387.  
  388.                                     Silvia Borri
  389.  
  390.                                  Juan Jose Comellas
  391.  
  392.                                     Filippo Dini
  393.  
  394.                                  Fabrizio Fioravanti
  395.  
  396.                                  Cristiano Guidoccio
  397.  
  398.                                 Giovanni Lopes Pegna
  399.  
  400.                                   Marco Maccaferri
  401.  
  402.                                   Marco Menichelli
  403.  
  404.                                    Giuseppe Scarpi
  405.  
  406.                                    Toni Tatafiore
  407.  
  408.                                     Duncan Wilcox
  409.  
  410.  
  411.                                                                               7