otclient-redemption/.gitattributes
Eduardo Dantas 8d98d5a6ba
fix: make client asset installation archive-first (#1739)
Restore archive first modern client asset installation

This commit reworks the modern client asset auto installation flow so the normal path is based on downloading and extracting the GitHub release or source ZIP instead of relying on the manifest flow as the primary installer.

The installer now keeps the final runtime files in the same locations already expected by OTClient. Asset files are installed under data things version, sound files are installed under data sounds version, and configured runtime extras are installed into their expected runtime locations such as bin.

The manifest based path is still kept as a compatibility fallback, but it is no longer the preferred installation path for modern client assets. This restores the archive first behavior and makes the install result match the standard runtime loader layout more directly.

For client versions 1281 and newer, OTClient now checks the existing files under data things version before attempting installation. When auto install is enabled and the required files are missing, the client prompts the user, downloads the configured release or source ZIP, extracts the assets folder into data things version, extracts the sounds folder into data sounds version, and installs configured runtime extras into their target runtime paths.

If Services clientAssets enabled is false, OTClient now skips the asset ensure download flow during login. This avoids recursive login attempts caused by the installer prompt and keeps manual or custom asset folders usable. In that mode, OTClient proceeds with the provided local files and lets the normal runtime loader report missing or invalid assets when appropriate.

The archive extraction support was also expanded. ZIP extraction now works through the vendored minizip fallback when libarchive is not available. Visual Studio project configuration was updated to enable libarchive so Windows builds can handle ZIP and RAR archive extraction. Android builds remain safe because unsupported libarchive linkage is not required there.

Main changes included in this commit

• Restores archive first installation for modern client assets

• Keeps the manifest path only as a compatibility fallback

• Downloads the GitHub release or source ZIP as the normal install path

• Extracts assets into data things version

• Extracts sounds into data sounds version

• Installs runtime extras into their expected runtime locations such as bin

• Keeps final installed files in the same OTClient runtime paths already used by the loader

• Adds ZIP extraction support through the vendored minizip fallback

• Enables libarchive in the Visual Studio project for Windows archive extraction

• Allows Windows builds to handle ZIP and RAR extraction through libarchive

• Preserves Android build safety by not requiring unsupported libarchive linkage

• Skips asset ensure and download prompts when Services clientAssets enabled is false

• Avoids recursive login attempts when asset auto install is disabled

• Keeps manual and custom asset folders usable

• Lets the normal runtime loader report actual missing or invalid files when auto install is disabled

• Documents the archive first flow fallback behavior install paths and troubleshooting notes

Runtime behavior

For modern client versions 1281 and newer, OTClient first checks the existing files under data things version. If the files are already present, login continues without triggering the installer.

If files are missing and auto install is enabled, OTClient prompts the user and installs assets from the configured GitHub release or source archive. The archive folders are mapped into the runtime locations expected by the client.

The assets folder is installed into data things version. The sounds folder is installed into data sounds version. Runtime extras such as bin files are installed into their configured runtime destinations.

If auto install is disabled, the installer is not called during login. The client continues with the manually provided files and the regular loader remains responsible for reporting any actual asset problems.

Verification performed

• luac p modules client assets client assets lua init lua

• luac p modules client entergame entergame lua

• git diff check

• Local Windows build using vc18 otclient sln OpenGL x64 Build

• GitHub Actions fast checks passed on the PR branch

• GitHub Actions Lua syntax checks passed on the PR branch

Overall this commit restores the expected archive based installation flow for modern client assets while preserving compatibility fallback behavior. It keeps installed files aligned with the existing OTClient runtime layout improves archive extraction support across build targets and avoids unwanted installer prompts when automatic asset installation is disabled.
2026-06-12 09:11:21 -03:00

8 lines
154 B
Text

# Normalize source code before commits
.gitattributes text eol=lf
*.lua eol=lf
*.md text eol=lf
*.txt eol=lf
*.ot* eol=lf
*.cpp eol=lf
*.h eol=lf