﻿
# Patch Progress File (InfFile) Specification

The patch progress file records the last patch ID, which has be
successfully processed during a patch process. Any higher patch ID
is considered to be unprocessed, partially processed or failed
processing, and is subject to be processed anew during new patch
process.

## Format Definition (Normative)

The patch ID is saved as a 32-bit unsigned integer in little-endian
byte order.

## Explanation of the Format Definition (Informative)

The patch ID is stored in a binary format, 4 octets (8-bit bytes) in
length, with the least significant byte first and the most
significant byte last, i.e. little-endian byte order.

    305419896 (decimal)
    ↓
    0x12345678 (hexadecimal)
    ↓
    12 34 56 78 (individual bytes, most significant first)
    ↓
    78 56 34 12 (individual bytes, least significant first)

A patch ID of 0 (zero) would be encoded as:

    00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F 0123456789ABCDEF
    00 00 00 00                                     ....

A patch ID of 1 (0x00000001) would be encoded as:

    00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F 0123456789ABCDEF
    01 00 00 00                                     ....

A patch ID of 1000 (0x000003E8) would be encoded as:

    00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F 0123456789ABCDEF
    E8 03 00 00                                     è...

A patch ID of 100000 (0x000186A0) would be encoded as:

    00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F 0123456789ABCDEF
    A0 86 01 00                                      †..

## Creating a new Patch Progress File (Informative)

A new, zero initialized patch progress file is created when:

- All custom archives that previously used an update method that is
  incompatible with Elurair, because the patch list was not usable
  with Elurair.
- All new custom archives that were not subject to updating, yet.

A new, non-zero initialized patch progress file is created when:

- All custom archives that previously used an update method that is
  compatible with Elurair, but where the process was recorded in a
  different format (for example as human-readable number). The patch
  progress file shall then be initialized with an ID, that
  corresponds to the last patch ID that the archive was updated
  with. Care must be taken whether the previous patch progress was
  recorded as last-applied-ID or next-to-be-applied-ID.

An existing patch progress file is used when:

- All official archives that use the official patcher (version 1
  or 2), or RO Patcher Lite. The patch progress file is usually
  called <optional prefix>patch<optional suffix>.inf (for example
  patch.inf, patchRE.inf or spatch.inf).
- All custom archives that previously used an update method that is
  fully compatible with Elurair. Examples include the customized
  official patcher or customized RO Patcher Lite prior to v2.4.5.
