7zip native support

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

User avatar
j7n
Member
Member
Posts: 192
Joined: 2005-08-07, 21:56 UTC

Re: 7zip native support

Post by *j7n »

Thank you for your work adding 7-Zip to Windows XP. I didn't realize that it presented as much difficulty compared to other formats.
#148174 Personal license
Running Total Commander v8.52a
lelik007
Member
Member
Posts: 173
Joined: 2021-04-20, 06:37 UTC

Re: 7zip native support

Post by *lelik007 »

2ghisler(Author)
-mqs+ and -mqs- are currently not supported, I don't know how to pass that to the dll. Maybe as "on" and "off"?
Actually + and - mean exactly "on" and "off" but IDK how they're passed.
It's allowed to use reduced forms for boolean switches: sw+ or sw instead sw=on, and sw- instead of sw=off.
Or maybe to write it in "Help" and this is it.
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) »

Actually + and - mean exactly "on" and "off" but IDK how they're passed.
I tried to pass them unchanged, e.g.
Name of option = "qs"
Value of option = "+"
and the 7-zip dll recognized it correctly.
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)
I tested both internal and external packers with -mqs+,
(though in real use I've never ever seen this exact switch like this -mqs or -mqs=on is usually preferred)
and -mf- to disable all filters. The switches work because the difference with or without them is obvious.
And the archives are 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) »

Great, thanks for testing! Please let me know if you find any other strange parameter option which doesn't work.
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)
OK!
2MaxX
-mx switch you use now works in any form you like: -mx -mx9 -mx=9
lelik007
Member
Member
Posts: 173
Joined: 2021-04-20, 06:37 UTC

Re: 7zip native support

Post by *lelik007 »

2ghisler(Author)
We've got the issues:

1. Users report that they can't add a file or a folder to a subfolder of an archive. And this only affects external packer 7z.exe/7zG.exe, because for internal it works. As I checked it out it's true. Something is wrong with u command for external packer it either isn't passed at all or returns false immediately.

2. А file or a folder can't be deleted from an encrypted archive, only affects external packer 7zG.exe; 7z.exe asks for a password, this means it wasn't passed. Also a user's report and I confirm this.

3. Unknown: a bug or a feature, affects internal packer if you add a file to an archive with a replacement, the whole directory where is at also added with it, if "Save Paths" checkbox is checked. If "Save Paths" is unchecked the file is replaced without a directory added.

The issues were tested with the default settings.

Same thing here:
viewtopic.php?t=84480
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. There is no parameter for 7zg.exe to add files to a subfolder. WinRAR has this option: -ap:
WinRAR Help wrote:
Switch -AP<path> - set path inside archive
-------------------------------------------------------------------------------
The path defined using this switch is merged to file names when adding files to an archive and removed from file names when extracting.
For example, if you wish to add the file readme.txt to the folder DOCS\ENG of archive release, you may run:
WinRAR a -apDOCS\ENG release readme.txt
or to extract ENG to the current folder:
WinRAR x -apDOCS release DOCS\ENG\*.*
Available for RAR and ZIP formats only.
2. Do I need to pass the password? Or just a parameter so 7zg it asks for it? Shouldn't 7zg ask by itself?

3. Makes no sense. How do i reproduce this? I have tried adding a single file or folder to an existing archive with F5, and it added just that file/folder.
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)

2. In 7zFM if you open an archive with a password you don't need anything to delete a file, so I think in this case you need to pass a password.

3. I reproduced it like this, downloaded this https://download.cpuid.com/cpu-z/cpu-z_2.12-en.zip , unpacked it, then packed it to .7z,
so it's cpu-z_2.12-en.7z now. Then in the left panel I entered cpu-z_2.12-en.7z, in the right the unpacked folder cpu-z_2.12-en and D'n'Ded file cpuz_x64.exe to the left panel (it already existed in archive so it was a replacement) and cpu-z_2.12-en directory was also added. It happens when "Save Paths" is checked and for internal packer. If "Save Paths" was unchecked the folder was not added.
I mean that you should add the same file that is already in archive.
Last edited by lelik007 on 2024-11-22, 14:51 UTC, edited 2 times in total.
lelik007
Member
Member
Posts: 173
Joined: 2021-04-20, 06:37 UTC

Re: 7zip native support

Post by *lelik007 »

2ghisler(Author)
About, 1, I understood incorrectly. Yes, you are right there's no switch for this, there's Igor's clarification.
https://sourceforge.net/p/sevenzip/discussion/45798/thread/f3c3faa766/
But somehow internal packer does it, the same way as 7zFM.exe I suppose.
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. But somehow internal packer does it, the same way as 7zFM.exe I suppose.
Yes, you can tell the 7z.dll exactly how it should name the files in the archive, and where they are located on disk. You can't do this with 7zg.exe.
2. In 7zFM if you open an archive with a password you don't need anything to delete a file, so I think in this case you need to pass a password.
OK, I will try that.
3. Then in the left panel I entered cpu-z_2.12-en.7z, in the right the unpacked folder cpu-z_2.12-en and D'n'Ded file cpuz_x64.exe to the left panel (it already existed in archive so it was a replacement) and cpu-z_2.12-en directory was also added. It happens when "Save Paths" is checked and for internal packer. If "Save Paths" was unchecked the folder was not added.
This does not happen here. Total Commander asks whether it should overwrite cpuz_x64.exe, and if I agree, it does just that and doesn't add any extra folders. Are you sure you didn't drag the parent folder to the archive?
Btw, do you use the tc7z.dll included with Total Commander, or did you replace it with another one?
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)
3.
The first user who described this possible bug was AkulaBig on another forum, at that time I didn't know that he was a user here or he was going to report it. I did manage to reproduce it, I'm sure nothing else was selected. He's been using for testing 7z.dll v24.08 from the distro, I've been using for testing for all this time whatever bundled with TC Beta. Might be additional conditions there were for it to be reproduced.
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) »

Maybe I'm misunderstanding how you are packing the file? Here is a short video I made with a fresh ini file. I changed the date+time of the cpuz_x64.exe file to current to show you that the file was actually overwritten in the archive:
https://www.ghisler.ch/images/dragfileto7z.mp4
As you can see, no extra folders were added. I used the Windows snipping tool for the recording because I just got Windows 11 24H2 and the Xbox game bar recording is broken (only one image every few seconds).
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)
Yes, you I understood it right, I did the same exact thing. I think we should leave it for the time when maybe another user will describe additional conditions for this to happen.
lelik007
Member
Member
Posts: 173
Joined: 2021-04-20, 06:37 UTC

Re: 7zip native support

Post by *lelik007 »

2ghisler(Author)
Christian, by the way, I don't know how you understand -slp , but let me clarify these things:

1. Windows 10, (as I have exactly it) has a policy "Lock pages in memory" here's described where it is:
https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/enable-the-lock-pages-in-memory-option-windows?view=sql-server-ver16
gpedit.msc: Local Group Group Policy - Computer Configuration - Windows Settings - Security Settings - Local Policies - User Rights Assignment -
Lock pages in memory policy.

1.1 By default it has no owner, a user with administrative privileges should assign this policy to himself so he can use Large Pages in any software at all.
It affects all the SW and you do it once. This policy is needed because a SW to use LP (Large Memory Pages) must reserve all the memory amount it requires for an operation right away. If a SW at the beginning of an operation can't allocate and lock the free memory amount it needs for an operation it will use the regular pages. I mean any SW, 7-zip is not different.

2. The policy can only be enabled if you run once with administrative rights - 7zFM.exe - Tools - Options - Settings - "Use large memory pages" and reboot after it. So now your user account owns "Lock pages in memory policy" and it's seen clearly as: "Owner".
-slp switch for 7zG.exe, 7z.exe, 7za.exe 7zr.exe does not enable this policy, It only tells or to use LP or not to use it. If the policy is not assigned they just ignore it and use the regular pages.

3. 7-max is Igor Pavlov's SW that basically force the other SW to use LP and its help contains more detailed information about it, you can just unpack and read it. https://7-max.com/

4. I'm neither a developer nor a coder but here in advance how this mode is called out:
https://learn.microsoft.com/en-us/windows/win32/memory/large-memory-support
simple example:
https://mahdytech.com/large-pages-how-when/
Last edited by lelik007 on 2024-11-26, 16:39 UTC, edited 2 times in total.
Post Reply