Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

C# wrapper for 7z.dll. Modified to work with COM Wrappers and NativeAOT Compilation on .NET 8

License

NotificationsYou must be signed in to change notification settings

CollapseLauncher/SevenZipExtractor

 
 

Repository files navigation

C# wrapper for 7z.dll (x86 and x64 included). Due to a compatibility issue with "Source Generated" COM Interop, this fork only works with .NET 8.
This fork has been modified to work withNativeAOT andILTrimming on .NET 8. This fork also adds other features such as:

  • Cancellable extraction
  • Progress event
  • Latest 7z.dll library (Currently: v23.01)

However, all the credits for the initial works have been done by the original creator:Alexander Selishchev

This fork is unfortunately still unavailable on NuGet but if you prefer one, please refer to the original version here:

NuGetNuGet

Every single star makes maintainer happy! ⭐

NuGet

Install-Package SevenZipExtractor

Supported formats:

  • 7Zip
  • APM
  • Arj
  • BZip2
  • Cab
  • Chm
  • Compound
  • Cpio
  • CramFS
  • Deb
  • Dll
  • Dmg
  • Exe
  • Fat
  • Flv
  • GZip
  • Hfs
  • Iso
  • Lzh
  • Lzma
  • Lzma86
  • Mach-O
  • Mbr
  • Mub
  • Nsis
  • Ntfs
  • Ppmd
  • Rar
  • Rar5
  • Rpm
  • Split
  • SquashFS
  • Swf
  • Swfc
  • Tar
  • TE
  • Udf
  • UEFIc
  • UEFIs
  • Vhd (?)
  • Wim
  • Xar
  • XZ
  • Z
  • Zip

Examples

Extract all

CancellationTokenSourcetokenSource=newCancellationTokenSource();using(ArchiveFilearchiveFile=newArchiveFile(@"Archive.ARJ")){archiveFile.Extract("Output",tokenSource.Token);// extract all with cancellable control using token}

Extract to file or stream

using(ArchiveFilearchiveFile=newArchiveFile(@"Archive.ARJ")){foreach(EntryentryinarchiveFile.Entries){Console.WriteLine(entry.FileName);// extract to fileentry.Extract(entry.FileName);// extract to streamMemoryStreammemoryStream=newMemoryStream();entry.Extract(memoryStream);}}

Guess archive format from files without extensions

using(ArchiveFilearchiveFile=newArchiveFile(@"c:\random-archive")){archiveFile.Extract("Output");}

Guess archive format from streams

WebRequestrequest=WebRequest.Create("http://www.contoso.com/file.aspx?id=12345");HttpWebResponseresponse=(HttpWebResponse)request.GetResponse();using(ArchiveFilearchiveFile=newArchiveFile(response.GetResponseStream()){archiveFile.Extract("Output");}

Wiki

7z.dll

7z.dll (x86 and x64) will be added to your BIN folder automatically.

License

Changelog

1.0.17 / 2022.04.08

  • #54 4Gb+ archives fixed! 🎉 (ThanksPyroluk)

1.0.16 / 2021.01.17

  • 7z binaries updated to 21.07.0.0
  • PR#56 - signature forSquashFS (Thanksmmoosstt)
  • PR#53 - look for binaries inbin folder (ThanksCupSunshine)

1.0.15 / 2020.01.14

  • .NETStandard 2.0 support PR#38

1.0.14

  • Entry.Extrat - preserveTimestamp is true by default #34
  • Dynamic operations can only be performed in homogenous AppDomain" #36

About

C# wrapper for 7z.dll. Modified to work with COM Wrappers and NativeAOT Compilation on .NET 8

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C#100.0%

[8]ページ先頭

©2009-2025 Movatter.jp