FH2 Patcher

Support Information

If you're having problems patching your FH2 installation, please post a thread here including the logfile created by the patcher (fh2-patch-debug.log) in your mods/fh2 directory.

Technical Information

The FH2 patcher ("fh2patch") is built upon xdelta3, an excellent binary delta system by Josh McDonald. It also uses wxWidgets.

A single fh2patch input file defines a collection of steps to take to update an installation from an expected start state to an end state, or from any point between the start and end states (in other words, partial patches do not ruin an installation).

Step Types

File Encoding

The file format is very simple. In an ad-hoc syntax:

  action:
    enum(step type)
    if step type == 1:   # PATCH
      string(target path)
      hash(before)
      hash(after)
      string(xdelta3 diff)
    if step type == 2:   # DELETE
      string(target path)
    if step type == 3:   # ADD
      string(target path)
      string(data)
  
  data:
    integer(n_actions)
    action0
    action1
    action2
    ...
    actionn_actions - 1
    
  file:
    'FH2PATCHbyCTZ\0\0\0'
    hash(data)
    data

Here, integer() is encoded as unsigned 32-bit little-endian integer. string() is encoded as an integer(n) length followed by n bytes of ASCII. enum() is encoded as for integer(). A hash() is encoded as 16-bytes. The hash function used everywhere is MD5.

Invocation

fhpatcher.exe <patch file> <base path>

base path is added to the front of all target paths: this is the root of the installation.

fhpatcher.exe exits non-zero on error.

License

xdelta3 is licensed under the GPLv2. Therefore fh2patch is also licensed under the GPLv2.

    fh2patch - compact program installation updating system
    Copyright (C) 2008  Joseph Birr-Pixton

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Downloads