diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5dd832f..a8d0166 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,7 +3,7 @@ on: branches: [ "master" ] env: - VERSION: '1.6.1.${{ github.run_number }}' + VERSION: '1.6.2.${{ github.run_number }}' jobs: build: diff --git a/SevenZip/7z.dll b/SevenZip/7z.dll index 02d0974..7c1527a 100644 Binary files a/SevenZip/7z.dll and b/SevenZip/7z.dll differ diff --git a/SevenZip/7z64.dll b/SevenZip/7z64.dll index b028a37..2ba9f27 100644 Binary files a/SevenZip/7z64.dll and b/SevenZip/7z64.dll differ diff --git a/SevenZip/ArchiveOpenCallback.cs b/SevenZip/ArchiveOpenCallback.cs index 40d6ebf..c2d85f4 100644 --- a/SevenZip/ArchiveOpenCallback.cs +++ b/SevenZip/ArchiveOpenCallback.cs @@ -136,6 +136,7 @@ public int GetStream(string name, out IInStream inStream) _volumeFileNames.Add(name); if (_wrappers.ContainsKey(name)) { + _wrappers[name].Seek(0, SeekOrigin.Begin, IntPtr.Zero); inStream = _wrappers[name]; } else diff --git a/SevenZip/Formats.cs b/SevenZip/Formats.cs index d74d8f9..b8279bf 100644 --- a/SevenZip/Formats.cs +++ b/SevenZip/Formats.cs @@ -241,7 +241,12 @@ public enum InArchiveFormat /// Mach-O file format. /// /// Wikipedia information - MachO + MachO, + /// + /// Apple File System Format. + /// + /// Wikipedia information + Apfs } /// @@ -270,6 +275,11 @@ public enum OutArchiveFormat /// Wikipedia information BZip2, /// + /// Microsoft Windows Imaging disk image format. + /// + /// Wikipedia information + Wim, + /// /// Open Tar archive format. /// /// Wikipedia information @@ -425,7 +435,8 @@ internal static int GetMaxValue(Type type) {InArchiveFormat.Ntfs, new Guid("23170f69-40c1-278a-1000-000110D90000")}, {InArchiveFormat.Fat, new Guid("23170f69-40c1-278a-1000-000110DA0000")}, {InArchiveFormat.Mbr, new Guid("23170f69-40c1-278a-1000-000110DB0000")}, - {InArchiveFormat.MachO, new Guid("23170f69-40c1-278a-1000-000110DF0000")} + {InArchiveFormat.MachO, new Guid("23170f69-40c1-278a-1000-000110DF0000")}, + {InArchiveFormat.Apfs, new Guid("23170f69-40c1-278a-1000-000110C30000")} }; #endregion @@ -441,9 +452,10 @@ internal static int GetMaxValue(Type type) {OutArchiveFormat.SevenZip, new Guid("23170f69-40c1-278a-1000-000110070000")}, {OutArchiveFormat.Zip, new Guid("23170f69-40c1-278a-1000-000110010000")}, {OutArchiveFormat.BZip2, new Guid("23170f69-40c1-278a-1000-000110020000")}, + {OutArchiveFormat.Wim, new Guid("23170f69-40c1-278a-1000-000110E60000")}, {OutArchiveFormat.GZip, new Guid("23170f69-40c1-278a-1000-000110ef0000")}, {OutArchiveFormat.Tar, new Guid("23170f69-40c1-278a-1000-000110ee0000")}, - {OutArchiveFormat.XZ, new Guid("23170f69-40c1-278a-1000-0001100C0000")}, + {OutArchiveFormat.XZ, new Guid("23170f69-40c1-278a-1000-0001100C0000")} }; #endregion @@ -472,6 +484,7 @@ internal static int GetMaxValue(Type type) {OutArchiveFormat.SevenZip, InArchiveFormat.SevenZip}, {OutArchiveFormat.GZip, InArchiveFormat.GZip}, {OutArchiveFormat.BZip2, InArchiveFormat.BZip2}, + {OutArchiveFormat.Wim, InArchiveFormat.Wim}, {OutArchiveFormat.Tar, InArchiveFormat.Tar}, {OutArchiveFormat.XZ, InArchiveFormat.XZ}, {OutArchiveFormat.Zip, InArchiveFormat.Zip} diff --git a/SevenZip/SevenZipBase.cs b/SevenZip/SevenZipBase.cs index a746667..44350bd 100644 --- a/SevenZip/SevenZipBase.cs +++ b/SevenZip/SevenZipBase.cs @@ -210,10 +210,13 @@ internal void CheckedExecute(int hresult, string message, CallbackBase handler) case -2146233086: exception = new SevenZipException("Argument is out of range. (0x80131502: E_ARGUMENTOUTOFRANGE)"); break; + case -2147024690: + exception = new SevenZipException("Filename or extension is too long. (0x800700CE: ERROR_FILENAME_EXCED_RANGE)"); + break; default: exception = new SevenZipException( $"Execution has failed due to an internal SevenZipSharp issue (0x{hresult:x} / {hresult}).\n" + - "Please report it to https://github.com/squid-box/SevenZipSharp/issues/, include the release number, 7z version used, and attach the archive."); + "You might find more info at https://github.com/squid-box/SevenZipSharp/issues/, but this library is no longer actively supported."); break; } @@ -221,9 +224,7 @@ internal void CheckedExecute(int hresult, string message, CallbackBase handler) } else { - ThrowException(handler, - new SevenZipException(message + hresult.ToString(CultureInfo.InvariantCulture) + - '.')); + ThrowException(handler, new SevenZipException(message + hresult.ToString(CultureInfo.InvariantCulture) + '.')); } } else diff --git a/SevenZip/SevenZipExtractor.cs b/SevenZip/SevenZipExtractor.cs index e57cb33..5da8574 100644 --- a/SevenZip/SevenZipExtractor.cs +++ b/SevenZip/SevenZipExtractor.cs @@ -454,7 +454,7 @@ private IInStream GetArchiveStream(bool dispose) /// OperationResult.Ok if Open() succeeds. private OperationResult OpenArchiveInner(IInStream archiveStream, IArchiveOpenCallback openCallback) { - ulong checkPos = 1 << 15; + ulong checkPos = 1 << 23; var res = _archive.Open(archiveStream, ref checkPos, openCallback); return (OperationResult)res; diff --git a/changelog.md b/changelog.md index 6e1c10e..a7f7cd0 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,24 @@ # Changelog +## 1.6.2 (2024-04-10) +- Ensuring streams provided are at the beginning of the file, thanks to GitHub user fgimian. +- Fixed an issues where SFX archives would not be correctly detected, thanks to GitHub user fgimian. +- Added support for APFS format, thanks to GitHub user elihwyma. +- Added support for Wim format, thanks to GitHub user pysj. + +## 1.6.1 (2023-04-04) +- Fixed broken asynchronous extraction. + +## 1.6.0 (2023-03-31) +- Added option to leave streams open after extraction, thanks to GitHub user acrilly-msft. +- Added support for GPT and NTFS formats, thanks to GitHub user acrilly-msft. +- Added support for the CPIO format, thanks to GitHub user doug24. +- Changed how the Unique ID's are generated, thanks to GitHub user RoadTrain. +- Fixed an issue with multi-volume archives of more than 1000 parts, thanks to GitHub user in1gma. +- Fixed an issue when extracting from a read-only file, thanks to GitHub user benjicoh. +- Fixed an issue with appending to archives with encrypted headers, thanks to GitHub user amarendrabiorad. +- Fixed an issue when appending to encrypted archives, using streams. + ## 1.5.2 (2023-03-22) - Fixed an issue when seeking in streams with SeekOrigin.End, thanks to GitHub user bneidhold. - Fixed an issue when checking multi-volume 7z archives, thanks to GitHub user panda73111. diff --git a/package.lite.nuspec b/package.lite.nuspec index 0098baa..342ebdd 100644 --- a/package.lite.nuspec +++ b/package.lite.nuspec @@ -11,7 +11,12 @@ LGPL-3.0-only https://github.com/squid-box/SevenZipSharp 7z sevenzip sevenzipsharp 7-zip - Fixed broken asynchronous extraction. + + Ensuring streams provided are at the beginning of the file, thanks to GitHub user fgimian. + Fixed an issues where SFX archives would not be correctly detected, thanks to GitHub user fgimian. + Added support for APFS format, thanks to GitHub user elihwyma. + Added support for Wim format, thanks to GitHub user pysj. + diff --git a/package.regular.nuspec b/package.regular.nuspec index 469dfec..0438aa6 100644 --- a/package.regular.nuspec +++ b/package.regular.nuspec @@ -11,7 +11,12 @@ LGPL-3.0-only https://github.com/squid-box/SevenZipSharp 7z sevenzip sevenzipsharp 7-zip - Fixed broken asynchronous extraction. + + Ensuring streams provided are at the beginning of the file, thanks to GitHub user fgimian. + Fixed an issues where SFX archives would not be correctly detected, thanks to GitHub user fgimian. + Added support for APFS format, thanks to GitHub user elihwyma. + Added support for Wim format, thanks to GitHub user pysj. + diff --git a/readme.md b/readme.md index 9a5f898..f47a7a8 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,22 @@ This is a fork from [tomap's fork](https://github.com/tomap/SevenZipSharp) of the [original CodePlex project](https://archive.codeplex.com/?p=sevenzipsharp). +------------------------------------------------------------- + +------------------------------------------------------------- + +------------------------------------------------------------- + +# Project Archived +As of 2024-04-10, I've decided to officially release the final version of this fork - 1.6.2 - and archive the project. I myself don't use it anymore, and the sporadic bursts of activity from me aren't useful and I have a hard time even doing good code reviews on submitted code as I'm not actively working on this anymore. + +The bugs that exist will remain, feel free to fork this repository (as I once did from tomap) if you want to fix something. + +------------------------------------------------------------- + +------------------------------------------------------------- + +------------------------------------------------------------- + ## Continuous Integration | Squid-Box.SevenZipSharp | Squid-Box.SevenZipSharp.Lite |