rikyoz / bit7z

A C++ static library offering a clean and simple interface to the 7-zip shared libraries.
https://rikyoz.github.io/bit7z
Mozilla Public License 2.0
634 stars 116 forks source link

[Bug]: bit7z::BitFormat::Zip extract Exception #135

Closed TimelifeCzy closed 1 year ago

TimelifeCzy commented 1 year ago

bit7z version

3.2.x

Compilation options

No response

7-zip version

v22.01

7-zip shared library used

7za.dll / 7za.so

Compilers

MSVC

Compiler versions

vs2019

Architecture

x86

Operating system

Windows

Operating system versions

20H2

Bug description

Zip:

`

    bit7z::Bit7zLibrary lib(str7zFullPath.c_str());
    std::shared_ptr<bit7z::BitExtractor> extractor = nullptr;
            extractor = std::make_shared<bit7z::BitExtractor>(lib, bit7z::BitFormat::Zip);
            extractor->extract(strResPath.GetString(), strDest.GetString());

`

Error: extractor->extract catch{ Exceptional }

7z

extractor = std::make_shared<bit7z::BitExtractor>(lib, bit7z::BitFormat::SevenZip);

Success

Steps to reproduce

No response

Expected behavior

No response

Relevant compilation output

No response

Code of Conduct

rikyoz commented 1 year ago

Hi! The problem is in the DLL you're using: 7za.dll supports only the 7z format. For also extracting Zip archives, you should use the 7z.dll. You can check the formats and features supported by each of the 7-zip DLLs on this page: https://github.com/rikyoz/bit7z/wiki/7z-DLLs.

TimelifeCzy commented 1 year ago

Thank You

rikyoz commented 1 year ago

You're welcome!