ZPAQ wcx plug-in 1.2a
---------------------

A packer plug-in (wcx) for Total Commander for the ZPAQ format.
Based on zpaq 7.05.

Zpaq is a journaling (append-only) archiver for incremental backups.
Files are added only when they differ from the version(s) already stored.
Both the old and new versions are saved.
It also features:
* Multithreaded compression
* Unique deduplication feature, which will reduce archive size,
  even if you don't compress at all (compression method 0)
* Encryption (AES-256)
* (Remote) Multi-part support with optional local index file
* "Rollback" of archives to an earlier state
See http://mattmahoney.net/dc/zpaq.html for more details.

In short: you can't delete files, only add new ones,
but it's very efficient for detecting duplicate file fragments,
when you'd add several versions of a file to an archive.
Additionally it has very efficient compression modes (level 4/5),
which in most cases creates even smaller files than 7-Zip in it's best mode,
but can be quite slow.
The lower compression methods (up to 2) compress fast, and decompress very fast.

In default mode, when you open a zpaq archive in TC, you can only see either the
latest update's files, or all "collected" files from all updates you made,
with each file showing it's newest version, just like you would expect from other
archivers (zip, rar, ...).
This view depends on how files were added to an archive.

To use the unique journaling feature, i.e. when you want to get your
old file versions, enable the 'Show all archive versions' option
(through 'Pack files' -> select 'zpaq' -> 'Configure'),
so that you will be able to view all of the archive's updates.
For that you will now see unique dir names in the root of the archive,
(either ascending eight-digit strings, or a date string representing the
date when that version was added to the archive) which will portray
every update you made to it.
This means you can decompress your old file versions out of the archive,
like you would with every other file.
This will also mean that you won't see all your files "collected" in one single dir.
Use e.g. TC's branch view (Ctrl + B) for that.

It's probably best to leave the default view enabled most of the time, when you
just add files to the archive, but enable it if you need an old version out of it.

For using more than just one compression/decompression thread,
the x64 version is highly recommended. 
While two parallel threads might initially work on 32-bit, they could fail
to work until the end, crashing the plug-in.

Compression level 4 is very slow, and level 5 is extremely slow,
so take care before starting them with huge file collections.



System and memory requirements
------------------------------

Total Commander 7.50 or newer is required.
Works on Windows 2000, XP or newer (no support for Windows 9x).
A SSE2 capable CPU (for 32-bit version, all x64 CPUs support SSE2 anyway),
or use the non-SSE version from the plug-in archive (see installation section below).

I recommend at least 384 MB of RAM for the base use, but when you try to decompress
a new/unknown zpaq archive you should be aware that the creator of such archive
might have used the maximum compression level/method (5) for it, meaning that
up to 850(!) MB are needed when using one decompression thread.
In such case 1024 MB system mem should be the minimum (and will use most of your
RAM for decompression), but if you want to use more than one thread,
the memory requirements need to be multiplied by the number of threads!

Also note that there is additional 'management' data needed for the compression/decompression
procedure, which can be as high as 50 MB, and even increases with the number of files
you try to process at once, and the number of threads you use.

You should take special care in the 32-bit TC, because a 32-bit program can only
use up to 2 GB of RAM (TC isn't flagged as 'large address aware').
Therefore it might crash, even with a mem usage WAY below 2 GB, due to address space
fragmentation and several other factors.
A typical scenario I tested to crash under 32-bit is: 
 - compress a large file with level/method 3 and two threads -
which might crash although it doesn't use more than ~1100 MB.
For such reasons I recommend to only use one thread at all time in 32-bit.
Note that the 32-bit plug-in is LIMITED to two threads anyway.

The plug-in supports background packing/unpacking.
For using more than one operation in parallel, the memory requirements will
of course accumulate!

The plug-in will likely catch memory exceptions.
So when you get a message like: 'bad allocation'
you will know that you've run out of memory.

There is a plug-in option to warn you about memory requirements.

tl;dr
- 384 MB might be enough for decompress (if you're lucky!),
  but are definitely enough for compressing and decompressing your own archives
  with level 0 or 1 (one thread) only
- 1024 MB minimum for being on the safe side for compression/decompression, when using one thread
- 2048 recommended for two threads
- 3072 for three threads, and so on
- for 32-bit version: best try to keep mem usage below ~1000 MB (or always use one thread)

The rough memory requirements per thread in summary:
 Method  Compress  Decompress
   0      64 MB(?) <=32 MB(?)
   1      128 MB     32 MB
   2      450 MB    128 MB
   3      450 MB    400 MB
   4      550 MB    550 MB
   5      850 MB    850 MB



Installation
------------

Just open the plug-in archive in TC and it can install the plug-in (as packer plug-in) automatically.
Otherwise copy the archive's content to the location you want (preferably a sub-dir
of TC's installation directory) and select the plug-in manually in the configuration.

There is a non-SSE version of the 32-bit plug-in provided, which will work on
older CPUs that either lack any SSE instructions whatsoever, or don't support SSE2
(Athlon XP, Pentium III etc.), but is slower, due to the lack of a JIT compiler.
Just overwrite the original plug-in file with it, when the plug-in isn't loaded
(like directly after a TC restart).

The plug-in ships with both the 32- and 64-bit version.
If you don't use Total Commander x64 you may delete the 'zpaq.wcx64' file
to free some space, likewise delete the 'zpaq.wcx' if you never plan to use 32-bit.



Notes and Limitations
---------------------

* REALLY take care not to set compression mode or thread count to a level
  which doesn't fit to your system RAM.
  For example, when you use TC portable and created an archive on a machine
  with enough RAM and later try to append to that archive on a machine with less
  RAM, the plug-in might crash, and the archive might be left in an invalid state.
  For that I recommend to leave the default setting to ONE thread for 32-bit TC
  and to use the 'Warn about memory requirements' option ALL the time.

* While you can cancel compressing/decompressing in the progress dialog,
  you should be quick with it, as it would only be able to react before starting a new file.
  This means that when compressing/decompressing one big file, the procedure might not
  be able to break after the (short) initial data collection.
  Likewise, sending that dialog to background should be done as soon as possible
  after starting the procedure.

* Currently the progress dialog will only receive one update per file. It means
  that you won't see any progress (the progressing percentage number) when packing
  or unpacking huge files to/from an archive, but only after they have been processed.
  Compressing or decompressing one single large file will therefore only update the
  dialog once (after the initial data collection), but won't show any progress until
  it's finished and the dialog is dismissed anyway.
  It's the same behavior you'd see with the standalone zpaq program.
  Triggering more updates for the dialog would require complicated changes in the Zpaq
  core, and for this reason it is not planned to change soon.

* Zpaq uses a large data buffer for each thread, which complicates canceling a
  pack/unpack process. This means that even if you are able to cancel an unpack
  operation (see above) it will take some time until the data in the buffer has
  been processed, so that all threads can finish in a valid state.

* Currently it is not possible to "pause" an unpack operation through the progress dialog.

* Pausing a pack operation through the progress dialog will work, but might trigger
  only after a few seconds (or even more than one minute, in case of compression
  method 4/5), due to that data buffer mentioned above.

* When you switch the 'Show all archive versions' option, you shouldn't expect to
  see a change immediately when you open an archive through 'return' or Ctrl + PgDown in TC.
  The reason is that TC caches the content of the last used archive in RAM (no matter
  the archive type), and will use it until a restart or until you open any different archive.
  If you don't want to restart TC every time, just try to briefly open some other
  archive file, and try to reopen the zpaq archive afterwards, to finally see the change.
  Otherwise any file request in such a 'cached' archive (like unpacking or viewing a file)
  might produce errors, as the files are not available by that "old" cached paths any more.

* If you enabled the 'Mask stored drive letters / UNC names' option, it is possible to
  have duplicate file entries (when multiple files originated from the same path, but on
  different drives). While TC shows the correct attributes, extracting such files
  will not distinguish between the entries and always extract the first file in the list,
  no matter which one you selected.

* When being asked for a password, you can choose between two encodings:
  UTF-8 and ANSI (OEM is probably only needed for old Windows versions).
  The reason is that the standalone zpaq program uses UTF-8 when using a command
  like "-key xxx", but ANSI encoding when using "-key" (when key is empty it prompts
  for a password).
  If you created an archive with the latter variant and used a password that has
  at least one non-ASCII character, you will probably not able to open it with
  UTF-8, hence the choice.
  When creating a new archive you best leave the default UTF-8 and don't worry
  further, though it is not clear if the Unix zpaq program will always use a password
  encoded in UTF-8, which could hinder portability.
  When in doubt, always use passwords with ASCII-only characters.

* If you didn't enable the 'Show all archive versions' option and try to add
  a file which is already present in the archive, TC will of course ask to overwrite
  it. You can safely confirm that dialog all the time, as there is no data lost
  by doing so (assuming there are no archive errors through mem shortage, etc.),
  due to zpaq's journaling feature.

* If you did enable the 'Show all archive versions' option and try to add
  files to those special dirs representing the archive versions, they will of course
  not end up in there, but in a newly created dir in the archive's root,
  representing the newest archive version you just added.

* Currently a newly created archive will not be deleted if you canceled the pack
  process, or if there were write or different errors. This might change in the future though.

* You should be aware of the different compression methods's 'symmetry':
  method 1 -> asymmetric (decompression is a lot faster than compression)
  method 2 -> asymmetric
  method 3 -> slightly asymmetric (decompression is still a bit faster than compression)
  method 4 -> symmetric (decompression takes roughly the same time as compression)
  method 5 -> symmetric
  As you can see, especially level 4 and 5 is probably not what you're accustomed to
  from the common archivers (Zip, 7-Zip, Rar, etc.), because decompression is usually
  a lot faster than compression for those.
  So really use these levels only if you can and want to trade compression efficiency for
  compression speed AND decompression speed.

* Zpaq features that will not work or will work differently:
  - unpacking empty directories will not keep their timestamps from the archive,
    as this is a TC limitation (TC creates all empty dirs by itself, not requesting
    them from the plug-in at all)
  - likewise, extracting Alternate Data Streams for empty directories doesn't work
    for the same reason (no way to know if the user requested them for extraction)
  - NTFS Alternate Data Streams won't show in the TC file listing, and can't be extracted
    individually; use the standalone zpaq executable for that
  - unpacking files to a location with path length > 259 will not work,
    as this is a TC limitation (because Windows itself has certain problems with such paths)

* Note some (current) limitations of the zpaq format:
  - it does not follow or save symbolic links or junctions
  - it unknowingly follows hard links
  - it does not save owner or group IDs, ACLs, extended attributes
  - the file timestamps have a resolution of one second, which is better than FAT
    file systems (two seconds), but worse than e.g. NTFS (100 ns)
  - only the (last) modification timestamps of files/dirs are saved, but NEVER
    the creation or last access timestamps
  - reliable self-exctracting archives are not available (there is some code present
    on the website, it doesn't really work solid and with decent error feedback
    though), so you currently can't create SFX archives in TC



Alternate Data Stream limitations
---------------------------------

* When unpacking ADS to a file, by overwriting an existing file, it won't delete
  streams that are not available in the archive any more, but only
  overwrite existing streams or create new ones. This means that the output file might
  not be completely consistent to the archived state, because "old data" may be left over.
  Currently there is no plan to change this, as the only alternative way would be to
  delete the file completely, and rewrite it, which is not advisable in most situations.
  As the ADS feature is hardly used at all, this shouldn't be a big problem.
  If you unpack files to a blank location, i.e. create new ones, the problem will
  of course not emerge, and all files will be recreated as expected.

* Using ADS and multiple versions of files/dirs (with the same internal path)
  can be problematic when trying to extract them:
  - ZPAQ's journaling feature only adds new files. If you removed an ADS stream from
    a file, this can't be reflected by the archive's content. This means that the normal
    archive view ('Show all archive versions' option disabled) will hold all "collected"
    ADS for a specific file. Extracting such file will recreate all ADS ever stored for
    the file (each in it's newest version of course).
    With the 'Show all archive versions' option enabled, you are able to extract a specific
    file state, without any already deleted ADS entries, but:
  - A new file version is only added when the file content or date changed.
    If you added a file with equal date but unequal content, by using the 'Force content
    compare for identical files' option, the file's ADS will probably be equal and therefore
    won't be stored again. Extracting such file will not find any ADS for that specific
    version (because they reside in an older version instead), and thus no ADS
    can be extracted.
    The only solution is to manually extract the older (oldest) file version with the
    same timestamp first, and then overwrite it with the newer version.
  - A similar problem occurs for directory ADS, when showing all archive versions:
    If the dir timestamp doesn't change (because you e.g. just manipulated a few files
    in a dir), there will be no new dir entry created in the archive, and of course no new
    ADS entries as well. The same solution as above helps: find the oldest archive entry of
    that dir with the very same timestamp, and extract it (including at least on file in
    a sub-location, because otherwise TC creates empty dirs by itself), to recreate all
    ADS for that dir.
  As a matter of course, those problems won't occur if you'd use an archive for storing
  just one version, like you would with the common archivers (Zip, 7-Zip, Rar, etc.).



Multi-part archives and remote backups
--------------------------------------

Opening and creating multi-part archives is supported by the plug-in.
The basic format is "part001.zpaq, part002.zpaq, ...", with an optional index "part000.zpaq".
This means a group of digits anywhere in the file name, starting with one and increasing with
each part, and the optional index being all zero digits.

Basically that feature allows you to make fast incremental updates as separate files
(part001.zpaq, part002.zpaq ...), that you can move offsite (or not), keeping only a
small index locally (part000.zpaq).
Each part represents a single "update" of the archive.
With the index file you can list or compare the archive contents from just the index,
without retrieving the rest of the archive at all!
This might come in handy if you moved your backup files to an offline/remote location,
but still want to know what's in it.
That single index file will still allow you to update the archive (creating a new part),
i.e. no other part needs to be present in order to create the next update,
because the index contains all subscripted deduplication data needed for an update.
If you keep all files local, then zpaq will make sure they are consistent with the index
(if available) when you update such archive.
To restore any files out of the archive, you would retrieve parts 1 and higher and extract as usual.
When updating a multi-part archive, zpaq will create a new part using the next available
part number, starting with 1. If an index (part 0) is present, then it is also checked for
consistency (number of versions and archive size) and updated. An index is created only if
part 1 is also created. Thus, if you do not intend to move the archive parts to a remote location
then you may safely delete the index and it will not be re-created.
See the standalone zpaq executable or the zpaq homepage for further details.

To create a new multi-part archive you'd use the same syntax as in the standalone zpaq executable:
When packing, TC shows you the 'Pack files' box with the target file name, and the zpaq
extension already added, e.g.:
  zpaq:c:\myfile.zpaq
Now just append a question mark wildcard group anywhere in the file name (in the name only,
not the other path parts), which will represent that digit group used for the parts, e.g.:
  zpaq:c:\myfile???.zpaq
This would create 'c:\myfile001.zpaq' and the index 'c:\myfile000.zpaq'.
It is recommended to use a decent digit group length, if you expect a lot of updates,
like at least three digits or so. The position of the digit group in the name doesn't matter,
but it is recommended to put it to the "very right", i.e. closest to the file extension.

To list or extract, or appending to existing multi-part archives, things are way easier,
since there is an optional multi-part detection. See the 'Multi-part detection' option
explanation below for details.
Just make sure you hold all relevant parts in the same dir, if trying to extract files
from such archive. You'd see an error message otherwise.



Settings / Options
------------------

You can set all options by a dialog accessible through
'Pack files' -> select 'zpaq' -> 'Configure'.
As TC doesn't provide another access to that dialog, the decompression/misc
settings need to be configured in there also.
The options are saved in the config file 'pkplugin.ini', which is normally located
in the same location as the TC main config file ('wincmd.ini'), and where
all packer plug-ins can store their settings (but only a few actually do).
You could manipulate that file directly (most key values are represented by numbers),
but I don't recommend it.

'Compression method/level':
  Sets zpaq's compression mode.
  It's the same level you'd set with "-method L" in the standalone zpaq program.
  Just be aware that method 4 and especially 5 can be VERY slow, even on fastest machines.
  Default is level 1.

'Threads':
  Sets the parallel threads for both compression and decompression.
  The maximum number you can set is the number of CPU cores detected for your system.
  So for s single (core) CPU you can only choose '1'.
  In 32-bit TC this is always limited to 2, no matter how many cores you have.
  Note the memory requirements section above for details on this.
  In 64-bit TC the string below the box will inform you about the cores detected
  on your system.
  It's the same amount you'd set with "-threads N" in the standalone zpaq program.
  Default is 1.

'Force content compare for identical files':
  Attempt to add files even if the last-modified date has not changed.
  Files are added only if they really are different.
  It's the same option you'd set with "-force" in the standalone zpaq program.
  Detailed explanation:
  Normally files are added only if the date (last modification timestamp) has changed
  since the last update. With this option you will override that behavior, but in any
  case the file will be deduplicated and not saved unless the contents have really changed.
  This means that when the option is disabled, a file is not read at all, if the
  timestamp AND file size AND attributes (hidden, write-only, etc.) are identical to
  a file of the same name (and path) already found in the archive. It might be
  dangerous in situations where a file content change doesn't affect those parameters.
  With that option enabled, the file's content is always checked for differences against
  the already stored file version, no matter the pretended equal parameters, so that
  you're definitely on the safe side if such situation occurs. Therefore the option 
  is basically a shortcut for speed when packing files, so that some e.g. multi-gigabyte
  file read operation doesn't even need to start to check for differences.
  Default is disabled.

'Don't mark files found only in the last update as deleted':
  Prevents marking files in the archive as deleted, when files existing in the
  archive's last update are not amongst the files intended for the current archive update.
  This makes zpaq consistent with the behavior of most non-journaling archivers.
  In other words: when disabled, all files from the last update which are not included
  in the current update will be marked as deleted, so that you would see in such archive
  in the normal view mode (w/o the 'Show all archive versions' option) only files from
  that very update you just made. When enabled and opening such archive, you would see all
  "collected" files from all updates you made, with each file showing it's newest version,
  just like you would expect from other archivers (zip, rar, ...).
  You should be consistent with this option, i.e. either enable or disable it
  for ALL updates you'd make to an archive, because otherwise you might "lose"
  some files in between the updates for the normal archive listing, and could only
  access them through the 'Show all archive versions' option.
  It's the same option you'd set with "-nodelete" in the standalone zpaq program.
  Default is disabled.

'Store drive letter / UNC name in path, when possible':
  Stores the drive letter or the UNC ComputerName (as in \\ComputerName\SharedFolder\Resource).
  That is, only if you pack files with absolute paths (e.g. from TC search results
  fed to list box)
  Directly packing a file from a normal view will not trigger it of course.
  Disabling that option will remove drive letters from the stored entry name,
  like with most other archivers.
  Default is disabled.

'Store NTFS Alternate Data Streams':
  Stores all available Alternate Data Streams from files and directories from NTFS drives.
  This means that every file is searched for available streams, and, if found,
  they are stored in the archive like every normal file.
  This will of course not find anything for non-NTFS file systems, like FAT on
  USB drives and SD cards, but won't trigger any errors by doing so, so that you
  may leave it enabled all the time.
  Currently this function will only work on Windows Server 2003 / Vista or higher
  (i.e. not on Windows 2000 and XP), as it relies on API functions only available
  for these OSes. Note that enabling this option will slow down the pack operation a bit
  (depending on the amount of files you want to add).
  Default is disabled.

'Show all archive versions':
  Enables the unique journaling feature, which you can e.g. see when you
  open an archive by pressing return or Ctrl + PgDown in TC.
  See the top section explanation for more details.
  Just keep in mind that you might not see a different listing of an archive
  immediately, when you already listed it shortly before, due to TC's content cache
  (see the 'Notes and Limitations' section above).
  Default is disabled.

'Show archive version names as detailed timestamp':
  When you enabled 'Show all archive versions', it will show the dir names in
  the archive's root as a date string, representing the date when that version
  was added to the archive, instead of the default ascending eight-digit string,
  in a format that you can customize in the text box below.
  The default format string is
    $Y-$M-$D-$h-$m-$s
  which will result in the dir names following the scheme:
    YYYY-MM-DD-hh-mm-ss
  You can customize the format string to your very liking, using any order of these
  individual date fields and any "aligning" characters, including spaces and Unicode
  characters, you prefer.
  Just note that all date fields ($Y, $M, $D, $h, $m, $s) are mandatory, meaning
  they are enforced to append to the dir names if you omitted some or all of them,
  so that all dir names are guaranteed to have individual names, no matter your
  customization.
  Additionally you can refer to different special fields in the format string.
  All special references are in the format "[percent sign][letter][minimum field width]".
  The minimum field width is a lower-case hex number (0-9 and a-f), which represents
  the fields guaranteed minimum width, filled with leading zeros.
  The fields for referencing are:
    %v  -  the ascending version/update number (the same you'd see w/o this option)
    %a  -  the number of added files for this update
    %d  -  the number of deleted files for this update
    %b  -  the compressed size for this update in Bytes
    %k  -  the compressed size for this update in Kilobyte (kibibyte - KiB)
    %m  -  the compressed size for this update in Megabyte (mebibyte - MiB)
    %g  -  the compressed size for this update in Gigabyte (gibibyte - GiB)
    %s  -  the number of added NTFS Alternate Data Streams for this update
           (%a already includes this number)
  Hence the format string can get as complex as e.g. :
    '%v4 $D-$M-$Y_$h$m$s +%a4 -%d4 (%s2 ADS) (%ba %m6)'
  which could result in things like:
    '0007 04-11-2015_181534 +0260 -0017 (02 ADS) (0014842769 000014)'
  Note that the dir names might not sort in an ascending order, if you
  changed the order of the date fields. In that case you can still sort the dirs
  by date in TC (Ctrl + F5).
  Also note that when changing the format string, you might not see a different
  listing of an archive immediately, when you already listed it shortly before,
  due to TC's content cache (see the 'Notes and Limitations' section above).
  Default is disabled.

'Mask empty archive versions':
  When you enabled 'Show all archive versions', this option will mask all "empty"
  archive versions, so that you won't see them in the archive's root. Empty means
  that a version dir either contains no files at all or empty dirs only.
  When adding something to an archive, zpaq always creates another entry, even if
  you didn't add anything new to an archive. For constant backups of the same files,
  where you don't want to check for a change in file timestamp and/or content, this
  option will therefore help you showing only the relevant versions of your files
  (but TC's branch view (Ctrl + B) would of course also help in such case).
  Default is disabled.

'Mask stored drive letters / UNC names':
  When enabled, it will mask (delete) drive letters or the UNC ComputerName
  (as in \\ComputerName\SharedFolder\Resource) possibly stored within the archive,
  which can be there due to the 'Store drive letter / UNC name when possible' option,
  or archives created by the standalone zpaq program.
  Note: this will not work with 'Show archive version names as timestamp', since
  there's no reliable way to detect drive letter dirs in that mode.
  Default is enabled.

'Extract and set directory timestamps, if stored':
  When enabled, it will try to set the 'last modified' date of folders you just extracted.
  This is done after all files have been extracted, so you won't see it happen if you
  canceled an unpack process.
  To be able to do this there must be single directory entries stored within the
  archive, which is the case with all archives you created with the plug-in, but
  might not be the case with archives created with the standalone zpaq program.
  You might not want to enable this if there are already files existing within a dir
  structure, where unpacking to and setting a dir date might not represent a file-set
  state as it was intended, but for e.g. unpacking files to a new (empty dir) location
  it makes sense.
  Default is enabled.

'Extract NTFS Alternate Data Streams, when possible':
  Extracts all stored Alternate Data Streams, if this is possible for the target
  locations's file system.
  This means it will only work for NTFS targets, and not for things like FAT USB sticks,
  but won't trigger any errors by doing so, so that you may leave it enabled all the time.
  Of course this also means that ADS not belonging to a file/dir you selected for unpacking
  will not be extracted, but only the streams belonging to your selection.
  Unlike the 'Store NTFS Alternate Data Streams' option, extracting ADS should work
  on all systems.
  Default is disabled.

'Warn about memory requirements':
  Shows a warning dialog when your memory requirements might exceed the safe limits,
  every time when you:
   - close the config dialog
   - start an unpacking process
   - start a packing process
   - start a test archive process
  When you confirm the dialog you'd continue the operation despite the warning,
  otherwise you'd cancel it (or return to the config dialog).
  You might want to keep this enabled for the 32-bit version (see the memory
  requirements section above).
  Default is enabled.

'Keep last used archive password in memory':
  When dealing with encrypted archives, the plug-in will need to ask
  for a password every time you:
   - open an archive for listing (pressing return or Ctrl + PgDown)
   - unpacking files you selected in that listing
   - packing to an already encrypted archive file
   - creating a new archive file with the 'Encrypt' check box ticked
   - testing an encrypted archive file (Alt+Shift+F9)
   - searching within an encrypted archive file
   - ...
  By using that option, the last used archive name, path and attributes are stored
  together with it's password, so that these dialogs will appear less frequent.
  Since it's not that hard to read the password from e.g. viewing the raw process memory,
  you should probably disable that option when safety is a concern.
  Default is disabled.

'Support archive rollback when packing':
  Enables or disables support for archive "rollback".
  This means you can "cut" a custom number of coherent archive updates, starting
  from the "archive's back". So if you e.g. backed up some files you didn't mean to,
  then you can truncate the last update and repeat the procedure, or, if you need
  to, truncate even more updates.
  In other words: discard all archive updates AFTER the version you specify, and delete
  that compressed data from disk (i.e. whole part files in case of multi-part archives).
  In order to do this you need to pack new files to an archive into one of the
  "version sub-dirs". Normally this would update the archive in the usual way,
  adding a new version/update to that archive. But with this option enabled you
  will be asked for a rollback instead (so you will still have the chance to deny
  a rollback).
  It means that you should at least temporary enable the 'Show all archive versions'
  option, to display all version names in the archives root, navigate into one of
  these dirs, and now either copy your files into it (press F5), or drag and drop them.
  When you now confirm the question, you would discard all archive updates AFTER the
  version you just navigated to (represented by the dir name) and immediately after
  that pack all files you just copied/dropped to the archive, like any usual archive
  update. So for just discarding the LAST update, you would copy new files to the
  last but one (next to last) version dir, for discarding the last two updates you
  would copy files to the last but two (second from last) version dir, and so on.
  Copying files to the last/latest version dir therefore doesn't trigger a rollback,
  as there are no versions following it.
  Another method to rollback is to enter the sub-dir directly when packing.
  So when TC shows you the 'Pack files' box with the target file name, like
    zpaq:c:\myfile.zpaq
  you just append the desired version number in an eight-digit scheme, to which
  you want to rollback, i.e. the last version that should stay in the archive:
    zpaq:c:\myfile.zpaq/00000005
  (this would discard all updates after the 5th update)
  This would only work for an existing archive of course, and for a newly created
  archive you would pack all input files to the sub-dir '00000005' instead.

'Multi-part detection':
  Enables or disables the automatic detection of (remote) multi-part archives
  (part001.zpaq, part002.zpaq, ..., and optional part000.zpaq).
  Automatic detection means that when you open an archive for listing/decompression
  or packing, all archive files in the same directory are checked if they resemble
  a possible digit group scheme of the input file. If they do, and they have at least
  the minimum amount of digits that you set by this option, the archive will be opened
  as multi-part, by replacing the digit group characters with wildcards (question mark).
  If no index file ('part000.zpaq') is found, at least two archive parts need to
  exist, in order to treat the archive as multi-part. If this is the case and you
  are about to pack new files to such archive, you will be asked if you really want
  to treat it as multi-part, for not accidentally missing the sync of an index file
  currently placed elsewhere.
  A single index file w/o another part file will always be treated as multi-part for
  extracting, with this option enabled. If you have a file incidentally resembling
  the index part scheme (a group of all zero digits somewhere in the name), this may
  give an error message when trying to extract from it (but not when opening it for listing).
  Just turn the option off to treat it as a normal file instead.
  Note that when having multiple digit groups in the file name, the "last" group will be
  be used, i.e. the group being closest to the file extension.
  Default is disabled.



History
-------

Version 1.2a - Dec. 07. 2015
 - fixed: error preventing extraction of some files, when target dir structure wasn't similar to
   archive internal structure (number of target directory levels being smaller)
 - added new special field for the custom format string: number of added NTFS Alternate Data Streams
 - Chinese Simplified translation update (by 'wwj402')

Version 1.2 - Nov. 06. 2015
 - added optional support for archive "Rollback" when updating an existing archive
   -> works by dropping files into a version sub-dir, either when it's opened in TC's
      file list with the 'Show all archive versions' option, or by appending the
      version sub-dir name directly in the 'Pack files' path
   -> asks user before doing a rollback
 - added support for a detailed custom format for the 'Show archive version names as timestamp' option
   -> individual date fields ($Y, $M, $D, $h, $m, $s) are mandatory, meaning they are
      enforced to append to the dir names if being omitted
   -> additional special fields available: version number, number of added files, number of
      deleted files, compressed size (B, kB, MB, GB); all with definable minimum field width
 - fixed: crash after packing files to a detected multi-part archive finished
 - fixed: crash when starting packing and TC's 'also pack path names' option was disabled
   (when TC passed dir entries to the function)
 - fixed: unnecessary memory warning for x64 version when mem usage calculated 900...1000
 - fixed: incorrect load of 'Language' entry in 'pkplugin.ini' when having non-ASCII characters
 - unlocked OEM encoding for password dialog (possibly needed for older Windows versions)

Version 1.1c - Oct. 28. 2015
 - added 'Don't mark files found only in the last update as deleted' option
   ('-nodelete' equivalent)

Version 1.1b - Oct. 26. 2015
 - fixed: creating/updating or opening an archive with with path length > 259 didn't work
 - fixed: config dialog size for font > 8 was wrong
 - Chinese Simplified translation update (by 'wwj402')

Version 1.1a - Oct. 11. 2015
 - added 'Mask empty archive versions' option
 - fixed: resource leak (open directory handles) when using multi-part detection

Version 1.1 - Oct. 10. 2015
 - added optional support for NTFS Alternate Data Streams (storing and extracting)
   -> works for files AND dirs, but extracting for empty directories doesn't (TC limitation)
   -> checks target file system for ADS being available, before extracting
   -> for compression it needs Windows Server 2003 / Vista or higher,
      extracting works for all OSes
 - added optional (remote) multi-part detection
   -> needs at least two part files for detecting multi-part w/o index part file
   -> asks user before packing to detected multi-part archive but no index part found
   -> single index part file always treated as multi-part (error message when trying
      to extract from non-index file accidentaly having the '...xxx000xxx' name)
   -> configurable minimum digit group length
 - added config dialog options for ADS packing and extracting
 - added config dialog option for multi-part detection (minimum number of digits, or disabled)
 - fixed: when packing and 'Show all archive versions' enabled, files with the same paths were
   stored again (but deduplicated), even if they were identical to existing ones from an old
   version; reason: unique different internal paths due to prefixed version number scheme;
   behavior is now identical to standalone zpaq
 - fixed: packing files with path lenght > 259 to an archive didn't work
 - changed mem pre-warning color in config dialog to blue
 - config dialog mem warning colors can now be set through ini file (RGB integer)
 - changed: 'Language' entry in 'pkplugin.ini' is now also valid without BOM
   (when user removed it) when loading, but only if it transfers lossless to the
   UTF-8 section string found in the language file
 - renamed 'Force add identical file versions' option to 'Force content compare for identical files'
 - added Chinese Simplified translation (by 'wwj402')
 - some internal optimizations

Version 1.0 - Sep. 23. 2015
 - added compression method/level 0 support (store / dedupe only)
 - added 'Force add identical file versions' option
 - added 'Store drive letter / UNC name' option
 - added 'Show archive version names as timestamp' option
 - added 'Mask stored drive letters / UNC names' option
 - added 'Extract and set directory timestamps' option
 - added 'Warn about memory requirements' option
 - added 'Keep last used archive password in memory' option
 - added encrypt clue in option dialog
 - memory warning now also triggered before any pack or unpack operation,
   for safety reasons
 - memory warning now always considers available system memory
 - fixed: 'Show all versions' option wasn't saved correctly (reversed after TC restart)
 - fixed: all Windows forbidden characters for TC list are now masked
 - fixed: extremely slow archive listing for archives with a huge file set (50k+ files)
 - fixed: extremely slow extract operation when trying to set dir timestamps
   for archives with a huge file set (50k+ files)
 - added translation support ('zpaq.lng'):
   -> just create a new section with language name as section name and use
      the keys from the '(default)' section
   -> can set dialog font size for each language (between 8 and 11)
 - added German translation to zpaq.lng
 - added '(collecting file entries...)' message to progress dialog, before
   starting an unpack operation
 - added password encoding to pw dialog, reason: standalone zpaq uses UTF-8
   when using "-key xxx", but ANSI encoding when using "-key" (empty, prompts for password)
 - several fixes and improvements
 - added non-SSE2 x86 plug-in version
 - released source

Version 0.8 beta - Sep. 16. 2015
 - first (public) release



Author and Copyrights
---------------------

This plug-in was created by Michael Loster "milo1012".
It is released as freeware and can be distributed freely.
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
The source code (besides the third-party code mentioned below) can be used freely,
provided that the original author is mentioned for any use of modified or unmodified code.

This plug-in uses the zpaq source, which was released to public domain.
See the source provided, or http://mattmahoney.net/dc/zpaq.html for details.

This plug-in uses the SimpleIni library from Brodie Thiesfield, see the 'SimpleIni.h' file in the source for legal stuff.
