![]() |
#1 |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,363
|
Building nsisbi on non-Windows
Has anyone on this forum managed to build nsisbi on macOS or Linux? I'm using the same SCons parameters that work for standard NSIS, but always run into this error:
code: I've also tried specifying different TARGET_ARCH values and 64-bit versions of zlib, but to no avail. |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,175
|
I'm guessing this is related to 64-bit file sizes. Using 'fseeko' might work, depends on sizeof(off_t). There is usually a define you have to set at the top of the .cpp file before any #includes to trigger 64-bit support. You have to read about it in the documentation for your std c library and #ifdef in whatever code you need for your platform.
There should be plenty information about this, just google "fseek 64 yourplatform" etc. IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,363
|
Thanks for the hint, Anders. This looks promising:https://stackoverflow.com/a/4003512/1329116
Will give it a try on the weekend! |
![]() |
![]() |
![]() |
#4 |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,363
|
Building works fine when I add the following to Source/util.h:
code: The reason why I'm so interested in getting this to work is Homebrew, a popular package manager for macOS (also available for Linux). Now I have two options integrate this change: 1. patch util.h before building 2. hope that upstream adds this to util.h Both work fine, but of course the second option feels cleaner. Any objects to add these four lines of code, JasonFriday13? |
![]() |
![]() |
![]() |
#5 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 882
|
The main reason I have to use fseeko64() is to support installer sizes between 2GB and 4GB. off_t says it is defined as a signed type, so passing it anything over 2GB will cause an error.
You can try creating a 3GB installer and seeing if it errors out. "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#6 | ||
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,363
|
Quote:
Quote:
Last edited by Yathosho; 9th September 2018 at 01:22. |
||
![]() |
![]() |
![]() |
#7 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 882
|
Yeah, external files work fine because makensis doesn't need to know the size to write the external file out, it just stores the size in the first header.
All in one installers between 2GB and 4GB might be a problem, because of the signed int overflow, which is why I asked you to try a 3GB installer and see if it runs ok. fseeko64 might be gcc specific, I'm only using gcc on ubuntu for my testing. "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#8 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,175
|
http://www.gnu.org/software/libc/man...st-Macros.html tells you there are at least 3 configurations: _LARGEFILE_SOURCE, _LARGEFILE64_SOURCE and _FILE_OFFSET_BITS. Some make off_t/fseeko 64-bit and some add 64-bit specific functions and off64_t but at the end of the day you should be able to work with > 4GiB files on anything less than 20 years old probably.
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#9 | |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 882
|
Cool. In Platform.h, just define this before the includes, and see if that helps:
Quote:
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
![]() |
![]() |
![]() |
#10 | ||
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,363
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#11 | |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 882
|
Ok, so it is probably redirecting fseeko to fseeko64 behind the scenes, so I'll have to test this out (in source/util.h, after the includes):
Quote:
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
![]() |
![]() |
![]() |
#12 |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,363
|
This works fine. Thank you.
|
![]() |
![]() |
![]() |
#13 |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,363
|
Will you add these changes in the next version of nsisbi? My Homebrew formula patches the file right now, but of course it would be nicer without it.
|
![]() |
![]() |
![]() |
#14 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,175
|
I'm not opposed to taking this upstream as well at some point but we don't need it currently. It we ever need it, it should probably be a helper function in util.h. I don't want to take it right now because I don't want to maintain code that is unused (by us), toolchain specific, and not part of the C standard.
The only 64-bit file stuff we currently use is the file size of redirected stdout on Windows (IIRC). IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#15 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 882
|
The patch will be in the next version, but I am going to wrap it into a #ifndef _WIN32 block.
It's interesting though, some setups redirect the call, and some keep them separate. If I recall correctly, the 64 bit calls are only for all-in-one installers between 2GB and 4GB. I am considering adding another setting that allows splitting the data block into two parts, one for the exehead and one for the main install files. I'm thinking of using reservefile to add exehead specific files, the main reason is so that the installer .exe can become a downloadable stub, so that it downloads quick. Then it can be run with some downloader plugin that downloads the main datablock file. I will probably add a check for existing datablock files too, so that it only has to be downloaded once. Don't know when that will happen, I am quite busy at the moment. [edit] Also, I'm ok with which ever way nsis goes. It's quite nice having a fork because it keeps the main nsis package tight and lean, I don't actually like bloated software much. [/edit] "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#16 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 882
|
Oh and I also wondered why my downloads of nsisbi have spiked up, the homebrew script fetches my source code
![]() "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#17 | |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,363
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#18 | |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 882
|
Quote:
SetExOutFile has been renamed: OutFileMode auto|aio|data|stub Stub mode turns the installer into a stub, which can run without the main .nsisbin file. And this allows an internet plugin to download the file, and then use that for the install. StubFile, for adding files to the stub (otherwise identical to File) ReserveStubFile, for reserving files in the stub (otherwise identical to ReserveFile) VerifyExternalFile [path_to_nsisbin], used to verify and use the .nsisbin file. These are documented in the help files too. If you run into any issues, let me know ![]() Diff (use NSIS 3.04 stable as the base): https://pastebin.com/iKK3KC7p "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|