Package Update Rules
This page is the reference part of TapTap PC Game Update Mechanism, describing how files and directories inside the package are handled when TapTap delivers an update. For when incremental vs. delta updates apply, see Incremental and Delta Updates.
When TapTap delivers an update, it compares the file/directory manifests generated from the old and new packages, then handles manifest differences according to the rules below. Following these rules helps generate smaller patches and avoid accidentally deleting runtime data.
File/directory manifest
When TapTap parses each uploaded package, it generates a file/directory manifest from the package contents. The manifest records relative paths, file content information, and directories present in the package, including empty directories.
When a player updates from an old version to a new version, TapTap compares the old package manifest with the new package manifest. It does not scan the live state of the player's local game directory. In the tables below, "exists", "does not exist", "same content", and "different content" all refer to the path's state in the old and new package manifests.
Therefore:
- Files or directories that differ between the old and new manifests are downloaded, deleted, created, or kept according to the rules below.
- Files generated only in the player's local runtime directory, never included in the package manifest, and not under a directory matched by the directory deletion rule are not deleted or modified by the update flow.
- If a directory existed in the old package manifest but no longer exists in the new manifest, TapTap handles it according to the directory deletion rule. Files written into that directory at runtime are deleted as well.
File rules
| Old version file status | New version file status | TapTap behavior | Notes |
|---|---|---|---|
| ❌ Does not exist | ✅ Exists | Download new file | |
| ✅ Exists | ❌ Does not exist | Delete file | Old file content is not checked (deleted even if modified at runtime) |
| ✅ Exists | ✅ Exists, same content | Ignore | Old file content is not checked (ignored even if modified at runtime) |
| ✅ Exists | ✅ Exists, different content | Download diff blocks only | Old file content is not checked; ensure the old-version file is not rewritten at runtime |
| ❌ Does not exist | ❌ Does not exist | Keep file | Files generated at runtime are not deleted or modified |
Directory rules
Directories in the package (including empty ones) are recorded together with the package. Directory differences between old and new versions are handled as follows:
| Old version dir status | New version dir status | TapTap behavior | Notes |
|---|---|---|---|
| ❌ Does not exist | ✅ Exists | Create empty directory | Before install/update, TapTap creates the entire directory tree per the new structure |
| ✅ Exists | ❌ Does not exist | Recursively delete the whole directory | Anything written into it at runtime (logs, caches, user data, etc.) is also deleted |
| ✅ Exists | ✅ Exists | Keep | The directory itself is untouched; files inside follow the File rules above |
If a directory is removed in the new version, TapTap clears it entirely, and files written into it at runtime are deleted along with it. For directories involving user data / saves, place them in a dedicated directory outside the package from the start, to avoid accidental deletion when the directory structure changes in later versions.
Developer best practices
Saves and user data
- Place game saves in a dedicated directory (e.g.,
Saves/) and exclude it when packaging. - Place player personalization settings (key bindings, graphics, language, etc.) in a dedicated directory (e.g.,
UserSettings/) and exclude it from the package. - Never put user data inside a directory already included in the package — if that directory is removed in a later version, the runtime data inside will be cleared along with it.
Package content
- Read-only principle: Keep files inside the package read-only at runtime; never modify them dynamically.
- Stable paths: Keep the same relative path and filename for the same resource across versions; keep the directory structure stable and avoid renaming or deleting directories wholesale between versions.
- Remove redundant resources: Delete obsolete resource files to reduce patch size.
Getting the best incremental / delta results
- Keep the path and filename unchanged for the same file.
- Do not embed version-number information in the directory structure.
- Old-version files must not be rewritten at runtime.
- Precisely manage resource changes via version control, and keep temporary files out of the package.