Skip to main content

GeneralUpdate.Differential

Definition

Namespace: GeneralUpdate.Differential

Assembly: GeneralUpdate.Core.dll

This component provides capabilities for generating binary differential patch files (algorithm), file increment identification (version differences), deleted file identification (version differences), blacklisting, patch restoration, and more.

public sealed class DifferentialCore

Example

The following example defines methods for increment identification, generating binary patches, patch restoration, and setting blacklists. The packaging tool in the GeneralUpdate.Tools project also strongly depends on this component.

// Increment identification, generating binary patches
public async Task TestDifferentialClean()
{
// Path to the previous version's client folder
var path1 = "D:\\packet\\source";
// Path to the latest version's client folder
var path2 = "D:\\packet\\target";
// Path for generating patch files
var path3 = "D:\\packet\\patchs";
await DifferentialCore.Instance.Clean(path1, path2, path3);
}

// Patch restoration
public async Task TestDifferentialDirty()
{
// Path to the current version's client folder
var path1 = "D:\\packet\\source";
// Path for generating patch files
var path2 = "D:\\packet\\patchs";
await DifferentialCore.Instance.Dirty(path1, path2);
}

Annotations

DifferentialCore provides capabilities for increment identification, generating binary patches, patch restoration, and setting blacklists.

Methods

NameTypeDescription
Clean()MethodIncrement identification, deleted file identification, and generating binary patch files
Dirty()MethodPatch restoration (applying patches to old client files to achieve updates)

🌼Clean()

Method

Generate patch files [cannot include files with the same name but different extensions].

public async Task Clean(string sourcePath, string targetPath, string patchPath = null);

Parameters

sourcePath Path to the previous version's folder.

targetPath Path to the latest version's folder.

patchPath Directory to store the discovered incremental update files temporarily.

🌼Dirty()

Method

Apply patches [cannot include files with the same name but different extensions].

public async Task Dirty(string appPath, string patchPath);

Parameters

appPath Client application directory.

patchPath Path to the patch files.

Applicable to

ProductVersions
.NET5, 6, 7, 8, 9
.NET Framework4.6.1
.NET Standard2.0
.NET Core2.0