Repository navigation
Add Bandizip fallback for archive extraction - #4
Conversation
|
感谢提交这个改进!CI 已通过,解压工具的选择逻辑和新增测试我也看过了。 合并前想请你再确认三点:
后两点是代码审查中发现的潜在边界,并非已经复现的问题。如果你认为当前实现已有足够保护,也欢迎说明。谢谢! Thanks for the contribution! CI has passed, and I’ve reviewed the tool-selection logic and added tests. Before merging, could you please confirm:
The last two are potential review concerns, not reproduced bugs. If the current implementation already addresses them, an explanation would also be helpful. Thank you! |
|
Thanks for the review. Addressed the three points in
Full The Actions run for this new commit currently reports |
修改内容 / Summary
When 7-Zip is not installed or bundled, downloaded RAR/7Z/ZIPX/CAB files currently fail to extract even if Bandizip is installed. Add an automatic fallback to Bandizip's console tool (
bz.exe) for both online downloads and local archive imports, preserving 7-Zip priority and the existing ZIP/TAR extraction engines. Bound tar/bz execution so stalled tools cannot leave the task waiting indefinitely.未安装或附带 7-Zip 时,新增对 Bandizip 控制台工具
bz.exe的自动发现与备用解压支持。在线下载和本地导入共用此流程;检查与解压使用同一份锁定的临时快照,并为 tar/bz 增加超时处理。用户可见变化 / User-visible Changes
bz.exethrough application folders, registered Bandizip installations (including custom drives), standard installation directories, andPATH. No Bandizip binaries or new package dependencies are added.tar.exebefore extraction. Add bounded RAR5 header validation because libarchive omits junction/file-copy redirections from its listing. Detect RAR5 hard-link annotations even when tar prints regular-file permissions.The RAR5 guard follows the official format description; command arguments follow Bandizip's documented interface.
验证 / Verification
scripts/test-all.ps1: 254 tests passed (220 Core + 7 DataStore + 27 Updater), all three coverage gates passed, WinUI x64 build passed with zero warnings/errors, and the minimal release ZIP contract passed.WinUI acceptance on the final build, using an isolated release copy/new library with Bandizip 7.38.0.1 (
7.38 Beta x64), Windows bsdtar/libarchive 3.7.7, and no available 7-Zip:gui-local-import.7z, importedGuiLocalMod, both files matched source SHA-256 hashes.fluorite_croft_v3_nocrossib.7z(16,562,923 bytes). UI reported successful download/extraction; all 95 archive files matched independent Windows tar extraction by SHA-256..7zto exercise the Bandizip fallback. The existing installation, game and user library were not used.Earlier actual-tool validation on the initial PR commit passed 15 checks with the same tool versions: 7Z/ZIPX Unicode/space/nested paths and SHA-256 comparisons, CAB, stored/compressed RAR5, rejection of links/traversal/corruption, and noninteractive encrypted-archive failure. RAR fixtures came from libarchive's tests; junction/copy-link variants used corrected header CRCs. The compiled WinUI discovery methods found Bandizip on a custom drive with no 7-Zip available.
Local build used .NET 8.0.425 and existing Visual Studio MSBuild, with Microsoft build components supplied through process-local paths. No project dependency or build-script changes were needed.
Not verified: in-game behavior/deployment, other Bandizip versions, and other Windows tar versions. The GUI tests covered successful imports/downloads; timeout behavior was verified separately with automated real-process tests using shorter deadlines.
相关 Issue / Related Issue
No existing Bandizip issue or open pull request was found when preparing this change.