Official support for 7z
Moderators: Hacker, petermad, Stefan2, white
Official support for 7z
Hello,
Is in plan to add the official support for 7zip handling (at least unpacking) into the next version of Total Commander, instead of relying on an external plugin? As far as I know, 7z DLL is available for redistribution (GNU LGPL + unRAR restriction) so it would be nice to have 7zip support right "out of the box".
Is in plan to add the official support for 7zip handling (at least unpacking) into the next version of Total Commander, instead of relying on an external plugin? As far as I know, 7z DLL is available for redistribution (GNU LGPL + unRAR restriction) so it would be nice to have 7zip support right "out of the box".
- ghisler(Author)
- Site Admin
- Posts: 50861
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
I have indeed considered it, but unfortunately the DLL is huge because it supports also many other formats, and also supports packing...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50861
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
2Hurdet
Thanks, that looks quite good, the dll would be 350MB zipped. But the port is from 2010, I wonder whether it can still handle current 7zip archives...
2MVV
I don't see the advantage compared to the existing plugins. But including an unpack-only dll would help the "normal" users, though, who would get a 7zip download and don't know what to do with it. Advanced users could still install one of the 7zip plugins.
Thanks, that looks quite good, the dll would be 350MB zipped. But the port is from 2010, I wonder whether it can still handle current 7zip archives...
2MVV
I don't see the advantage compared to the existing plugins. But including an unpack-only dll would help the "normal" users, though, who would get a 7zip download and don't know what to do with it. Advanced users could still install one of the 7zip plugins.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
2ghisler(Author)
The advantage is that it can replace a lot of unmaintained plugins. In my case Total7zip replaced more than half a dozen other plugins for windows/linux archives, disk images and installers.
The ability to extract almost any common archive and pack to a few important ones is all I need. And while I like the plugin, I would still prefer an official support directly in TC. And who knows, maybe there would be some space for a few optimizations.
The advantage is that it can replace a lot of unmaintained plugins. In my case Total7zip replaced more than half a dozen other plugins for windows/linux archives, disk images and installers.
The ability to extract almost any common archive and pack to a few important ones is all I need. And while I like the plugin, I would still prefer an official support directly in TC. And who knows, maybe there would be some space for a few optimizations.
Windows 10 Pro x64, Windows 11 Pro x64
- ghisler(Author)
- Site Admin
- Posts: 50861
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
- ghisler(Author)
- Site Admin
- Posts: 50861
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
OK, I have added support for internal 7zip unpacking now. It was quite a challenge because the 7zip dll uses OLE interfaces with multiple inherintance, which isn't supported at all by Delphi 2. So I had to write an in-between C++ dll which exports normal functions and calls the complex 7zip interfaces...
Where can I find out what formats are supported by the larger 7zip dll?The advantage is that it can replace a lot of unmaintained plugins. In my case Total7zip replaced more than half a dozen other plugins for windows/linux archives, disk images and installers.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
And a few others based on these.7z's homepage wrote:Supported formats:
Packing / unpacking: 7z, XZ, BZIP2, GZIP, TAR, ZIP and WIM
Unpacking only: ARJ, CAB, CHM, CPIO, CramFS, DEB, DMG, FAT, HFS, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, RAR, RPM, SquashFS, UDF, VHD, WIM, XAR and Z.
Also, here is a source code for all 7z utils/libraries: http://sourceforge.net/projects/sevenzip/files/7-Zip/9.22/7z922.tar.bz2/download. It's not the newest one, but you might find an example in there of how to use the library.
Windows 10 Pro x64, Windows 11 Pro x64
- ghisler(Author)
- Site Admin
- Posts: 50861
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Thanks for the list! I already have the source code.
Btw, any 7zip experts here? I have tried to build the dll with VC6 and the Windows SDK as described in the readme, and the compiler goes through with no errors. However, the dll is only about 150k and does not even support the 7z native format. The precompiled dll works fine, though.
Btw, any 7zip experts here? I have tried to build the dll with VC6 and the Windows SDK as described in the readme, and the compiler goes through with no errors. However, the dll is only about 150k and does not even support the 7z native format. The precompiled dll works fine, though.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I'm definitely not an expert, but I managed to compile it successfully. I'm using VS2012, but the procedure should be the same for older versions.
I tried to load the projects to Visual Studio IDE, but I encountered several errors during the automatic conversion of project files and later during compilation. That's the reason, why I provided these command-line instructions.
- Download and install VC6 or newer and Windows SDK for WinXP SP2 or newer.
- Download and extract 7z sources.
- Edit file "<7z_sources_root>\CPP\7zip\Bundles\Format7zF\Format7z.dsp" and on lines 56 and 83change parameter "/out:" to anything you like.
Code: Select all
56: # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"C:\Program Files\7-Zip\7z.dll" /opt:NOWIN98 83: # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"C:\Program Files\7-Zip\7z.dll" /pdbtype:sept
- If you are using Visual Studio 2010 or newer, remove "/opt:NOWIN98" form all *.dsp or *.mak files. It's not supported anymore. It's only supposed to make the resulting binary a bit smaller - but slower too.
- Open a command prompt and use it for the following steps.
- Load Visual Studio environment variables by calling "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\vsvars32.bat" (use a proper path).
- Switch to 7z sources directory and specifically to "<7z_sources_root>\CPP\7zip\Bundles\Format7zF\".
- Run "nmake".
I tried to load the projects to Visual Studio IDE, but I encountered several errors during the automatic conversion of project files and later during compilation. That's the reason, why I provided these command-line instructions.
Windows 10 Pro x64, Windows 11 Pro x64
- ghisler(Author)
- Site Admin
- Posts: 50861
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Yes I read that too that I would have to use command line make. But this doesn't solve my problem: I would like to step through the dll in the debugger, but this is only possible when compiling it within the IDE. 
There is a project file
7zip\CPP\7zip\Archive\7z\7z.dsw
especially for VCC 6.0, and it loads without errors. But the compiled code is too small and cannot unpack anything. I tried to use your linker options in the IDE, but it didn't help.

There is a project file
7zip\CPP\7zip\Archive\7z\7z.dsw
especially for VCC 6.0, and it loads without errors. But the compiled code is too small and cannot unpack anything. I tried to use your linker options in the IDE, but it didn't help.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com