Вопрос

I have compiled makensis on linux. It works great when executed from a bash shell like this.

makensis /path/to/setup.nsi

I would like to execute it using a python script. I have tried the following:

#using the symlink in /usr/bin
subprocess.call("makensis setup.nsi")

#absolute path to makensis executable
subprocess.call("/usr/share/makensis/makensis setup.nsi")

#Change directory
os.chdir("/usr/share/makensis")
subprocess.call("makensis setup.nsi")

I have also tried passing the cwd arg to subprocess.call.

In all of these cases makensis is unable to find its dependencies. It is looking in /usr/bin/ and throwing this error:

Error: opening stub "/usr/bin/Stubs/zlib"

I am not sure if this is a problem with my python script or the way makensis was compiled. I am inclined to think it is the python script, since makensis works fine from the bash shell. Any pointers are much appreciated.

Edit: This is the scons command I used to build nsis:

scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA_PATH=no PREFIX=/usr/share/ APPEND_CCFLAGS=-m32 APPEND_LINKFLAGS=-m32 install-compiler
Это было полезно?

Решение

We use NSIS extensively, but I had never thought to try running it on a posix/unix platform. In any event, I checked around (since I'm always interested in more NSIS configs), and found this link -- which specifically identifies your issue and includes resolution

http://wiki.koshatul.com/Installing_Nullsoft_Scriptable_Installer_System_%28NSIS%29_on_BSD#Error:_opening_stub_.22.2Fusr.2Flocal.2Fbin.2FStubs.2Fzlib.22

Remove the NSIS_CONFIG_CONST_DATA_PATH=no if you have it from your scons line, check the paths are all good for building as well.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top