Extract7ZipArchive error code 2

220 views
Skip to first unread message

Krzysiek Eselter

unread,
Dec 2, 2024, 5:33:28 PM12/2/24
to innosetup
I build dev version of inno setup 6.4.0 to try new feature 7zip extract but I have problem with larger archive files.
Up to 2,13 GB all was fine (max file size inside archive 639 MB), but when I try archive 4,58 GB I have problem with unpack one big file inside (1,4 GB) it's about 60% of unpack process.
I try LZMA and LZMA2, different  solid block settings and dict size. There is now problem with unpackig archive with 7-zip and much faster.


Any idea why there is problem with "7z ANSI-C Decoder"?

Krzysiek Eselter

unread,
Dec 2, 2024, 5:43:10 PM12/2/24
to innosetup
There is no problem with unpacking archive with 7-zip and much faster.*

When unpacking I have free space and ssd and more than 40% free RAM.

Martijn Laan

unread,
Dec 3, 2024, 5:14:51 AM12/3/24
to inno...@googlegroups.com
For a file of 1,4 GB the 7-Zip decoder will use at least 1,4 GB of decompression memory regardless of the block size. Inno Setup will run out of memory quickly if you try to do that because it's a 32-bit application.

You can see the precise memory requirements in the log. Also see the help file.

Greetings,
Martijn

Op maandag 2 december 2024 om 23:33 schreef Krzysiek Eselter <krzyc...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/innosetup/4909ed8b-b804-4405-9f0d-8ee28eef8ab1n%40googlegroups.com.

Krzysiek Eselter

unread,
Dec 3, 2024, 5:37:45 AM12/3/24
to innosetup
So there is no option to extract larger file?

Martijn Laan

unread,
Dec 3, 2024, 6:54:06 AM12/3/24
to inno...@googlegroups.com
The LZMA SDK source code isn't very readable but I've tried and did not find anything which can decompress .7z files without these memory requirements. In other words, I think your test with 7-Zip itself only worked because you used the 64-bit version, and not because it has lower memory requirements. On the other hand it could also be using code not present in the LZMA SDK.

So to extract such a large file anyway you should decompress it using 7-Zip itself. By using one of the 64-bit command line versions for example.

All of this is assuming these are files you download first. If this is not the case you should not be using .7z files to begin with and just include the files in [Files].

Whether it's really I good idea to download a 4,58 GB file in an installer is something I also doubt.

Greetings,
Martijn

Op dinsdag 3 december 2024 om 11:37 schreef Krzysiek Eselter <krzyc...@gmail.com>:

Martijn Laan

unread,
Dec 3, 2024, 7:02:19 AM12/3/24
to inno...@googlegroups.com

So to extract such a large file anyway you should decompress it using 7-Zip itself. By using one of the 64-bit command line versions for example.

Or of course you can let Inno Setup compress and decompress it natively. As in: download installers instead of archives.

Greetings,
Martijn

Krzysiek Eselter

unread,
Dec 3, 2024, 7:03:20 AM12/3/24
to innosetup
I try achieve something like like that:
User can download only needed resolution on remastered movie files for game (Arcanum) but they can download it directly on moddb page or automatically by installer, and this almost work only problem is that one bigger file but maybe i will try other method like using windows build-in option to copy file from zip archive or some command line like you suggested.

Jernej Simončič

unread,
Dec 3, 2024, 4:17:41 PM12/3/24
to 'Martijn Laan' via innosetup on [innosetup]

On Tuesday, December 3, 2024, 12:53:55, 'Martijn Laan' via innosetup wrote:


The LZMA SDK source code isn't very readable but I've tried and did not find anything which can decompress .7z files without these memory requirements. In other words, I think your test with 7-Zip itself only worked because you used the 64-bit version, and not because it has lower memory requirements.

This really doesn't make sense to me – the decoder should need slightly more RAM than the dictionary size, not to hold the whole decompressed file.

 

I just did some tests – created an archive with 64-bit 7z.exe -mx=9 (256 MB dictionary size) with 4 files between 3 and 9 GB in size (21 GB total, compressed to 12 GB), then extracted it with 32-bit 7z.exe, 32-bit FAR Manager and 32-bit Nsis7z. They all extracted the archive without problems, 7z using 264 MB Working Set according to Process Explorer, FAR using 428 MB and NSIS 1 GB.

 

Maybe have a look at what the archive plugin for FAR and Nsis7z do?

 

-- 
< Jernej Simončič ><><><><>< https://eternallybored.org/ >


Experience varies directly with equipment ruined.
       -- Morner's Rule of Thumb

Krzysiek Eselter

unread,
Dec 3, 2024, 4:50:17 PM12/3/24
to innosetup

Krzysiek Eselter

unread,
Dec 3, 2024, 5:03:31 PM12/3/24
to innosetup
I also try unpack this archive with 32 bit version of 7-zip and no problem at all.

Martijn Laan

unread,
Dec 4, 2024, 11:50:05 AM12/4/24
to inno...@googlegroups.com
Op 3-12-2024 om 22:17 schreef Jernej Simončič:
Maybe have a look at what the archive plugin for FAR and Nsis7z do?

Neither of these use the LZMA SDK as far as I can see.

Greetings,
Martijn

Krzysiek Eselter

unread,
Dec 4, 2024, 9:33:06 PM12/4/24
to innosetup
I change from extract 7zip to copyHere method: https://learn.microsoft.com/en-us/previous-versions/windows/desktop/sidebar/system-shell-folder-copyhere
Now all working without problems. Install script:
https://pastebin.com/sYkzpEE2
Message has been deleted

Martijn Laan

unread,
Dec 12, 2024, 8:33:11 AM12/12/24
to inno...@googlegroups.com
Hi,


Op 3-12-2024 om 22:17 schreef Jernej Simončič:
This really doesn't make sense to me – the decoder should need slightly more RAM than the dictionary size, not to hold the whole decompressed file.

FWIW, found an old thread explaining it's a limitation of the LZMA SDK C code, which is what's inside Inno Setup.

https://sourceforge.net/p/sevenzip/discussion/45797/thread/281294b9/

Greetings,
Martijn
Reply all
Reply to author
Forward
0 new messages