7zip native support

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

lelik007
Member
Member
Posts: 173
Joined: 2021-04-20, 06:37 UTC

Re: 7zip native support

Post by *lelik007 »

I didn't find more appropriate topic to ask: why doesn't the internal 7-zip packer produce just the same archives that 7-zip/external does?
I don't know it's a bug or it's supposed to be like this, but everybody can reproduce it, for example:
Download Firefox, which by itself 7z SFX archive, unpack it.
https://ftp.mozilla.org/pub/firefox/releases/128.4.0esr/win64/en-US/Firefox%20Setup%20128.4.0esr.exe
then with the default TC setting for the internal packer - pack it (Archive1), then choose where your 7z.exe/7zG.exe is and switch to external packer and pack again to (Archive2) and these archives are similar but not identical, they are even not of the same size.

Why? Yes, 7-zip shows just the same very methods, dictionaries, filters but it can't show the very important parameters like -mfb= mmt= (that were used) mqs= the format itself doesn't store them, maybe they're different, IDK.

I couldn't find a way to reproduce the identical archives that internal 7-zip does with any settings of 7-zip/external packer, the external packer does the same exact archives as 7-zip with the same settings, they're identical by hash, but the internal is tuned differently so the archives are not identical.
User avatar
MaxX
Power Member
Power Member
Posts: 1166
Joined: 2012-03-23, 18:15 UTC
Location: UA

Re: 7zip native support

Post by *MaxX »

2lelik007
You're no alone. I have also noticed that output 7z files are always different.
Ukrainian Total Commander Translator. Feedback and discuss.
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: 7zip native support

Post by *petermad »

Confirmed - using the Internal 7-Zip packer seems to make slightly bigger archives. than using 7zG.exe from TC, Total7zip plugin or 7zFM.exe

7zG.exe from TC, Total7zip plugin or 7zFM.exe makes identical archives, when the settings are the same.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50386
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: 7zip native support

Post by *ghisler(Author) »

Try using the exact same 7z.dll you use with 7zg.exe also in Total Commander. You need to rename it to tc7z.dll / tc7z64.dll and put it in the total Commander directory.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: 7zip native support

Post by *petermad »

Try using the exact same 7z.dll you use with 7zg.exe also in Total Commander.
Did that - Internal 7-zip packing still makes slightly larger archives.

This applies to all test I made, except for a test where I unpack tc1150x64_b4.exe to an empty dir, mark all the items and pack to another dir - then I get Identical 7z archives. But if I go out of the dir with the files from tc1150x64_b4.exe and just mark that dir for packing , then I do not get identical 7z files when packing with and without the Internal 7-Zip Packer
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
white
Power Member
Power Member
Posts: 5743
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: 7zip native support

Post by *white »

petermad wrote: 2024-11-04, 11:54 UTC Did that - Internal 7-zip packing still makes slightly larger archives
Perhaps TC stores folder names separately while 7-Zip does not? (I'm just wondering, I have no clue)
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: 7zip native support

Post by *petermad »

Perhaps TC stores folder names separately while
Well that seems likely. If I pack a directory without subfolders, I get Identical archives, but not if there are subfolders in the dir - Hence I get identical archives when I pack the content of tc1150x64_b4.exe which does not have any subfolders.

The above also applies if I use the original Tc7z64.dll
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
lelik007
Member
Member
Posts: 173
Joined: 2021-04-20, 06:37 UTC

Re: 7zip native support

Post by *lelik007 »

I couldn't produce the identical archives with the official 7z.dll from just a batch of files without any folders and have no idea why this happens because 7zFM.exe shows no difference whatsoever.
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: 7zip native support

Post by *petermad »

7zFM.exe shows no difference whatsoever.
I tested a little more and it is not always either that I get identical archives just because there are no subfolders in the archive.

If I tests with for example the files from the latest Imagine 64bit plugin https://www.nyam.pe.kr/dev/imagine/download.php?arch=x64&unicode=1&full=1&setup=0&version=1.7.0 :
Imagine.chm
Imagine.wcx64
Imagine.wlx64
Imagine64.dll
Imagine64.exe
Readme.txt
Whatsnew.txt

Then if I pack all the files execpt the .dll and the .exe file i get identical 7z archives with Internal and external 7-Zip packer.
But if I include either the .dll or the .exe file, or both I get archives that are NOT identical.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
lelik007
Member
Member
Posts: 173
Joined: 2021-04-20, 06:37 UTC

Re: 7zip native support

Post by *lelik007 »

2petermad
Yes, you are right the archives are identical if:

1. There are no folders inside.
2. Only text files, I used 9 .doc files.

But then I packed 2 mp4 videos with no folders and the archives again are NOT identical.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50386
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: 7zip native support

Post by *ghisler(Author) »

1. Yes, I tell the packer to pack folders, but external 7-zip also packs folders - you can see that by checking the folder dates in a path, they are stored too when packing from TC with external 7zg.exe. So there must be something else.
2. I get the exact same size when packing 2 mp4 files using the included tc7z64.dll and the latest 7zg.exe version 24.8.0.0.
What compression parameters did you use? I use compressiom ratio 6, LZMA2, 4 threads, otherwise all set to default.
Author of Total Commander
https://www.ghisler.com
lelik007
Member
Member
Posts: 173
Joined: 2021-04-20, 06:37 UTC

Re: 7zip native support

Post by *lelik007 »

2ghisler(Author)
[img]https://www.upload.ee/thumb/17350725/7zdiff2.jpg[/img]
For me TBH the external packer is a way to go, the internal one is limited: certain parameters will work and some won't, for example, I don't think that
-slp will work with the internal packer, but I always use this switch.
User avatar
Usher
Power Member
Power Member
Posts: 1726
Joined: 2011-03-11, 10:11 UTC

Re: 7zip native support

Post by *Usher »

ghisler(Author) wrote: 2024-11-05, 08:23 UTCI use compressiom ratio 6, LZMA2, 4 threads, otherwise all set to default.
7-zip uses compression levels from 0 (store with no compression) to 9. Level 5 is default.
Andrzej P. Wozniak
Polish subforum moderator
User avatar
MaxX
Power Member
Power Member
Posts: 1166
Joined: 2012-03-23, 18:15 UTC
Location: UA

Re: 7zip native support

Post by *MaxX »

AFAIK, 7zip has these numbers for compression naming: 0, 1, 3, 5, 7, 9. No 6 is there.
But I don't think it could matter at all because 7z should take proper neighbor number in such situation.

My personal need is ONLY the best compression (9) with best word size and unlimited single solid block for each filter:
-mx=9
-mmt=2
-myx=9
-mqs
-mfb=273
-slp

The only thing I change is the dict size:
-md=64M
or
-md=256M
or anything else for any special case.

So I do my tests this way.
I found that internal TC's compressor makes slightly different archives with these "the best" parameters.
It would be great if internal 7z packer could pack IDENTICAL archives (compared with original 7z binaries).
Ukrainian Total Commander Translator. Feedback and discuss.
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: 7zip native support

Post by *petermad »

2ghisler(Author)
What compression parameters did you use? I use compressiom ratio 6, LZMA2, 4 threads, otherwise all set to default.
For us to test the same:
  1. Download: https://www.nyam.pe.kr/dev/imagine/download.php?arch=x64&unicode=1&full=1&setup=0&version=1.7.0
  2. Extract these files to an empty dir:
    Imagine.chm
    Imagine.wcx64
    Imagine.wlx64
    Imagine64.dll
    Imagine64.exe
    Readme.txt
    Whatsnew.txt
  3. Use these settings in TC: https://tcmd.madsenworld.dk/7zsettings.png
  4. Pack all files with external and thereafter with internal 7-Zip packer
    You get different 7z files
    .
  5. Now only pack these files with external and thereafter with internal 7-Zip packer
    Imagine.chm
    Imagine.wcx64
    Imagine.wlx64
    Readme.txt
    Whatsnew.txt
    You get identical 7z files
    .
Tested both with original Tc7z64.dll and with Tc7z64.dll replaced with the same 7z.dll as used with 7zG.exe.

So apparently it is not about whether the packed files are binary or not (the chm, wcx64 and wlx64 are binary)
I have also testet packing a series of archive files of different formats (rar, zip, ace etc) - and they pack identically with external and internal packer.
But apparently so far we know that .dll, .exe and some .mp4 files does not pack identically.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply