{"id":19538003,"url":"https://github.com/geoffsmith82/d7zip","last_synced_at":"2026-03-06T14:30:53.490Z","repository":{"id":40589300,"uuid":"46114794","full_name":"geoffsmith82/d7zip","owner":"geoffsmith82","description":" A Delphi Wrapper around 7z.dll","archived":false,"fork":false,"pushed_at":"2024-10-20T11:43:44.000Z","size":4813,"stargazers_count":47,"open_issues_count":5,"forks_count":13,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-26T04:31:30.564Z","etag":null,"topics":["7z","7zip","chm","compression","decompression","gzip","iso","lzh","wim","xz"],"latest_commit_sha":null,"homepage":"","language":"Pascal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/geoffsmith82.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-13T10:12:28.000Z","updated_at":"2025-02-25T16:22:52.000Z","dependencies_parsed_at":"2024-11-11T02:30:44.232Z","dependency_job_id":"d776b949-4675-46db-a577-f072a2d7aeb6","html_url":"https://github.com/geoffsmith82/d7zip","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/geoffsmith82/d7zip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoffsmith82%2Fd7zip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoffsmith82%2Fd7zip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoffsmith82%2Fd7zip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoffsmith82%2Fd7zip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geoffsmith82","download_url":"https://codeload.github.com/geoffsmith82/d7zip/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoffsmith82%2Fd7zip/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30180671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T12:39:21.703Z","status":"ssl_error","status_checked_at":"2026-03-06T12:36:09.819Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["7z","7zip","chm","compression","decompression","gzip","iso","lzh","wim","xz"],"created_at":"2024-11-11T02:30:28.235Z","updated_at":"2026-03-06T14:30:53.469Z","avatar_url":"https://github.com/geoffsmith82.png","language":"Pascal","readme":"# 7-zip Delphi API\n\n* Author: Henri Gourvest \u003chgourvest@progdigy.com\u003e\n* Licence: MPL1.1\n* Date: 2011-11-29\n* Version: 1.2\n* [Original source at Google Code](https://code.google.com/archive/p/d7zip/source/default/commits)\n* Extended version by Daniel Marschall 2024-05-15 with a lot of changes (see sevenzip.pas header for changelog)\n* Example usage Demo added by Geoffrey Smith\n\nThis API use the 7-zip dll (7z.dll) to read and write all 7-zip supported archive formats.  The latest 32-bit and 64-bit version of the 7z.dll is included in the repository (currently 24.08). According to the documentation, file formats listed below are supported, although many may only support decompression/extraction and not creation/compression.\n - zip\n - bz2\n - rar\n - arj\n - z\n - lzh\n - 7z\n - cab\n - nsis\n - lzma\n - lzma86\n - xz\n - ppmd\n - squashFS\n - cramFS\n - apm\n - mslz\n - flv\n - swf\n - swfc\n - ntfs\n - fat\n - mbr\n - vhd\n - pe\n - elf\n - macho\n - udf\n - xar\n - mub\n - hfs\n - dmg\n - compound doc\n - wim\n - iso\n - bkf\n - chm\n - split\n - rpm\n - deb\n - cpio\n - tar\n - gzip\n \n## 7-Zip Demo\n  This demo currently allows you to locate archives on your hard disk and list the contents of archive. It uses VirtualTree that you can get in the GetIt package manager in Delphi.\n\n  \n## Reading archive:\n### Extract to path:\n\n```pascal\nvar\n  archive : I7zInArchive;\nbegin\n  archive := CreateInArchive(CLSID_CFormatZip);\n  archive.OpenFile('c:\\test.zip');\n  archive.ExtractTo('c:\\test');\nend;\n\n```\n### Get file list:\n```Pascal\nvar\n  archive : I7zInArchive;\n  i : Integer;\nbegin\n  archive := CreateInArchive(CLSID_CFormat7z);\n  archive.OpenFile('c:\\test.7z');\n  for i := 0 to archive.NumberOfItems - 1 do\n    if not archive.ItemIsFolder[i] then\n      Writeln(archive.ItemPath[i]);\nend;\n```\n### Extract to stream\n```Pascal\n with CreateInArchive(CLSID_CFormat7z) do\n begin\n   OpenFile('c:\\test.7z');\n   for i := 0 to NumberOfItems - 1 do\n     if not ItemIsFolder[i] then\n       ExtractItem(i, stream, false);\n end;\n```\n### Extract \"n\" Items\n```Pascal\nfunction GetStreamCallBack(sender: Pointer; index: Cardinal;\n  var outStream: ISequentialOutStream): HRESULT; stdcall;\nbegin\n  case index of ...\n    outStream := T7zStream.Create(aStream, soReference);\n  Result := S_OK;\nend;\n\nprocedure TMainForm.ExtractClick(Sender: TObject);\nvar\n  archive : I7zInArchive;\n  i: integer;\n  items: array[0..2] of Cardinal;\nbegin\n  archive := CreateInArchive(CLSID_CFormat7z);\n  archive.OpenFile('c:\\test.7z');\n    // items must be sorted by index!\n  items[0] := 0;\n  items[1] := 1;\n  items[2] := 2;\n  archive.ExtractItems(@items, Length(items), false, nil, GetStreamCallBack);\nend;\n\n```\n### Open stream\n```Pascal\nvar\n  archive : I7zInArchive;\nbegin\n  archive := CreateInArchive(CLSID_CFormatZip) do\n  archive.OpenStream(T7zStream.Create(TFileStream.Create('c:\\test.zip', fmOpenRead), soOwned));\n  archive.OpenStream(aStream, soReference);\n   ...\nend;\n```\n### Progress bar\n```Pascal\nfunction ProgressCallback(sender: Pointer; total: boolean; value: int64): HRESULT; stdcall;\nbegin\n  if total then\n    Mainform.ProgressBar.Max := value \n  else\n    Mainform.ProgressBar.Position := value;\n  Result := S_OK;\nend;\n\nprocedure TMainForm.ExtractClick(Sender: TObject);\nvar\n  archive : I7zInArchive;\nbegin\n  archive := CreateInArchive(CLSID_CFormatZip);\n  archive.OpenFile('c:\\test.zip');\n  archive.SetProgressCallback(nil, ProgressCallback);\n  ...\nend;\n```\n### Password\n```Pascal\nfunction PasswordCallback(sender: Pointer; var password: WideString): HRESULT; stdcall;\nbegin\n  // call a dialog box ...\n  password := 'password';\n  Result := S_OK;\nend;\n\nprocedure TMainForm.ExtractClick(Sender: TObject);\nvar\n  archive : I7zInArchive;\nbegin\n  archive := CreateInArchive(CLSID_CFormatZip);\n  // using callback\n  archive.SetPasswordCallback(nil, PasswordCallback);\n  // or setting password directly\n  archive.SetPassword('password');\n  archive.OpenFile('c:\\test.zip');\n     ...\nend;\n```\n### Writing archive\n```Pascal\n procedure TMainForm.PackFilesClick(Sender: TObject);\nvar\n  Arch: I7zOutArchive;\nbegin\n  Arch := CreateOutArchive(CLSID_CFormat7z);\n  // add a file\n  Arch.AddFile('c:\\test.bin', 'folder\\test.bin');\n  // add files using willcards and recursive search\n  Arch.AddFiles('c:\\test', 'folder', '*.pas;*.dfm', true);\n  // add a stream\n  Arch.AddStream(aStream, soReference, faArchive, CurrentFileTime, CurrentFileTime, 'folder\\test.bin', false, false);\n  // compression level\n  SetCompressionLevel(Arch, 5);\n  // compression method if \u003c\u003e LZMA\n  SevenZipSetCompressionMethod(Arch, m7BZip2);\n  // add a progress bar ...\n  Arch.SetProgressCallback(...);\n  // set a password if necessary\n  Arch.SetPassword('password');\n  // Save to file\n  Arch.SaveToFile('c:\\test.zip');\n  // or a stream\n  Arch.SaveToStream(aStream);\nend;\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeoffsmith82%2Fd7zip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeoffsmith82%2Fd7zip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeoffsmith82%2Fd7zip/lists"}