Skip to content
⌘ NSIS Forum Archive

Hitting the 2GB file limit when creating an installer

6 posts

Itms#

Hitting the 2GB file limit when creating an installer

Hello,
We have been using NSIS for packaging our software for Windows, but we are having trouble for packaging our latest version. We are hitting the "Internal compiler error #12345" because a file that we package has grown past the size of 2GB. This file is big because it is not compressed at all: we use the lzma compression in NSIS, so the final installer is around 600MB.

As a workaround, we tried compressing the file first, and then running NSIS, but the result is less good because two successive compressions is suboptimal (the final installer ends up around 900MB). So we'd really like to work around the limitation on single input files.

I successfully built NSIS and managed to pass the large-address-aware flag to the linker, but that doesn't solve the issue. I read that other thread, but the hack detailed by arwa is not supposed to work with large input files like we have.
As far as I can see,
MMapFile::resize
is not called when the large file is about to be parsed, which explains why the mmap is not large enough, but I don't know why the resize doesn't happen exactly.

Would you have any input about how to fix the issue? I am competent in C++ even though I'm just discovering the NSIS codebase, so I should be able to hack together the ideas you might have.
Thank you very much for your help 🙂
Anders#
There is https://sourceforge.net/projects/nsisbi/ and https://github.com/ywjheart/Nsis64 that might be helpful
Itms#
Thank you for the quick reply, I saw that project but it states that "Single files are still limited to 2GB". I should maybe give it a try regardless.
Itms#
nsisbi worked! 😁

Since it compressed files before adding them to the mmap, the 2GB limit was not reached. I would like to reach jasonfriday13 so that the README of nsisbi states more clearly what are the limits of that project. I wouldn't have bothered you here if the README wasn't so gloomy 😉

Thanks again for the answer and for the great software!