Skip to content

Latest commit

 

History

History
191 lines (157 loc) · 8.66 KB

HowToInstall7z_en.md

File metadata and controls

191 lines (157 loc) · 8.66 KB

Language: 日本語 English

How to enable 7-zip from SevenZip.Compression.Wrapper.NET

1. Overview

In order to use SevenZip.Compression.Wrapper.NET, 7-zip must be properly installed. This article explains how to install 7-zip.

2. For Windows

2.1 Standard installation method

Please follow the steps below to install.

1.Download the appropriate 7-zip package for your computer from 7-zip official website. 2. Please install 7-zip. 3. Make sure there is a file named 7z.dll in the folder where 7-zip is installed (e.g. C:\Program Files\7-Zip). 4. Add the folder where 7-zip is installed to your PATH environment variable.

2.2 Manual installation method

In the following situations, the method shown in 2.1 Standard installation method may not work.

  • If you don't want or can't set the PATH environment variable
  • If you want to use SevenZip.Compression.Wrapper.NET on multiple architectures (x86 and x64) 1

To install manually, follow the steps below.

  1. Download 7-zip from 7-zip official website.
  2. Please install 7-zip.
  3. Make sure there is a file named 7z.dll in the folder where 7-zip is installed (e.g. C:\Program Files\7-Zip).
  4. Please check the folder where SevenZip.Compression.Wrapper.NET is installed. There should be a file named Palmtree.SevenZip.Compression.Wrapper.NET.dll in that folder.
  5. Copy 7z.dll to the folder where SevenZip.Compression.Wrapper.NET is installed.<!--

The installation is now complete. If you do not use 7-zip, you can uninstall it.

If you want to use SevenZip.Compression.Wrapper.NET on multiple architectures, please change the file name as shown below when copying 7z.dll.

  • For 7z.dll of x86 version 7-zip => 7z.win_x86.dll
  • For 7z.dll of x64 version 7-zip => 7z.win_x64.dll

3. For Linux

7-zip for Linux is provided as a single executable file and cannot be used as a library. Therefore, in order to use 7-zip from SevenZip.Compression.Wrapper.NET, you need to rebuild it using the 7-zip source code.

From now on, we will explain the build procedure assuming that you have a development environment such as gcc on Linux.

3.1 Steps (1) Obtain the latest version of the source code.

Please download the 7-zip source code from the 7-zip download page. It is best to use ".tar.xz".

3.2 Step (2) Unzip the source code

For example, to extract to the current directory, run the following command from the shell.

xz -dc 7z2301-src.tar.xz | tar xfv -

3.3 Step (3) Copy makefile

Obtain the makefile and copy it to the source file directory.

3.4 Step (4) Run make

Change the current directory to the directory where you copied the makefile, then run make. The following example is for building the x64 version of the library.

make -f makefile_x64.gcc

Once the build is complete, the 7-zip library lib7z.linux_x64.so (lib7z.linux_x86.so for the x86 version) should be created in the current directory.

Copy the created lib7z.linux_x64.so (or lib7z.linux_x86.so) to the directory where SevenZip.Compression.Wrapper.NET is installed.

Footnotes

  1. Even if your computer has x64 architecture, if your application that utilizes SevenZip.Compression.Wrapper.NET is a 32-bit application, you will need 7zip for x86.