Hello,
I'm building NSIS v.3.09 for linux. Here's the build command I am using:
scons SKIPSTUBS=all \
SKIPPLUGINS=all \
SKIPUTILS=all \
SKIPMISC=all \
NSIS_CONFIG_CONST_DATA_PATH=no \
PREFIX=build/nsis-3.09/ \
install-compiler
The problem is, the resulting executable looks for the Stubs folder one folder up from where the executable is copied by using "install-compiler". I do not know how to change this, except for using the NSISDIR environment variable. This also makes the existing documentation on building on POSIX systems incorrect. This appears to be a general problem based on this years old Stack Overflow question. Am I doing something wrong?
For reference, in build.cpp, the following code sets the search directory based on the makensis path. It appears to do so based on where the makensis executable is located at build time, instead of runtime.
tstring nsis_dir;
const TCHAR *dir = _tgetenv(_T("NSISDIR"));
if (dir) nsis_dir = dir;
else {
#ifndef NSIS_CONFIG_CONST_DATA_PATH
nsis_dir = get_dir_name(get_executable_dir(makensis_path));
#else
nsis_dir = _T(PREFIX_DATA);
#endif
}
definedlist.add(_T("NSISDIR"), nsis_dir.c_str());
tstring includes_dir = nsis_dir;
includes_dir += PLATFORM_PATH_SEPARATOR_STR _T("Include");
include_dirs.add(includes_dir.c_str(),0);
stubs_dir = nsis_dir;
stubs_dir += PLATFORM_PATH_SEPARATOR_STR _T("Stubs");
Any help is appreciated.
Writing this bug report helped me understand that the makensis.exe file, located at the root of the zip file, might just be calling the actual makensis.exe located in the Bin folder. That might be the reason why the resulting executable looks for the Stubs folder one folder up.
If this is the case, can we please rewrite this documentation to reflect that the PREFIX= variable must point to the bin folder of the zip instead of the extracted zip?
Just to be clear, currently the documentation shows the following information
I'm proposing to change it to something like:
Or make some change in the scons script that adds /Bin to the end of the PREFIX= variable.
Thanks for the help.
Last edit: Rodolfo Gonzalez Delgado 2024-03-04
Is it possible that the call at build.cpp:415 which is
should be:
Looking util.cpp:935, get_executable_dir() wraps a call to get_executable_path() in get_dir_name(). Perhaps the code a build.cpp:415 didn't take into account what this convenience function provides?
Maybe a fix like this:
Turns out that in '/SCons/config.py', it's already doing a platform check by default. So the fix can be simplified to this: