Yet another interesting MS API: Delta Compression Application Programming Interfaces.
I wasn’t aware of it until I check dependencies of squirrel.windows (another interesting thing which will justify a blog post of it’s own). squirrel.windows use DeltaCompressionDotNet (nuget). This is a thin wrapper around Delta Compression API.
Delta Compression API is made of two historical API: PatchAPI and MSDelta. Second one is the evolution of first one. MSDelta provides:
- removed Windows XP support,
- API simplified but with some loss (progression calback seems to be phased out),
- more file format with special handling (knowing file format permits to compute delta more effectively),
- more memory consumption mainly during delta creation phase.
DeltaCompressionDotNet is more simpler. Creating delta is as simple as:
var compression = new MsDeltaCompression(); /* or PatchApiCompression(); */
compression.CreateDelta(sourcePath, destinationPath, deltaPath);
and applying delta:
var compression = new MsDeltaCompression(); /* or PatchApiCompression(); */
compression.ApplyDelta(deltaPath, sourcePath, destinationPath);