Old 18th May 2022, 19:28   #1
pkonduru
Member
 
Join Date: Jul 2015
Posts: 86
Building on linux , no install.log

Hi All,
We were building an NSIS installer on a linux container using the NSIS logging build(2.46). Everything was working fine till now with the installer generating an install.log file when it is run. We updated our base container image with new JDK and now the installer that is being built is no longer producing the install.log. I don't see how the JDK and NSIS are tied together. This is what I use to build the NSIS in the linux container.

RUN mkdir /tmp/nsis &&\
yum install -y ca-certificates &&\
wget https://jaist.dl.sourceforge.net/pro...sis-3.02.1.zip -P /tmp/nsis/ &&\
wget https://jaist.dl.sourceforge.net/pro....1-src.tar.bz2 -P /tmp/nsis/ &&\
yum install -y scons glibc-devel glibc-devel.i686 &&\
unzip /tmp/nsis/nsis-3.02.1.zip -d /usr/local/ &&\
mv /usr/local/nsis-* /usr/local/nsis &&\
tar -xvf /tmp/nsis/nsis-3.02.1-src.tar.bz2 -C /usr/local/src/ &&\
mv /usr/local/src/nsis-* /usr/local/src/nsis &&\
cd /usr/local/src/nsis &&\
echo "#define NSIS_CONFIG_LOG" >> /usr/local/src/nsis/Source/exehead/config.h &&\
scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA_PATH=no PREFIX=/usr/local/nsis/bin install-compiler &&\
ln -s /usr/local/nsis/bin/makensis /usr/local/bin/makensis &&\
yum clean all &&\
rm -rf /var/cache/yum &&\
rm -rf /tmp/*

### we basically add the custom dialogs and plugins from our NSIS logging build here.
COPY 2.46.zip /tmp/
RUN mkdir /usr/local/nsis/p4thirdparty &&\
cd /usr/local/nsis/p4thirdparty &&\
unzip /tmp/2.46.zip &&\
cp -f Plugins/*.dll ../Plugins/x86-ansi/ &&\
cp -f Plugins/x86-ansi/*.dll ../Plugins/x86-ansi/ &&\
cp -rf Examples/* ../Examples/ &&\
cp -rf Stubs/* ../Stubs/ &&\
cp -rf Include/* ../Include/ &&\
cp -rf Contrib/* ../Contrib/ &&\
rm -rf /tmp/* &&\
rm -rf /usr/local/nsis/p4thirdparty
pkonduru is offline   Reply With Quote
Old 19th May 2022, 03:06   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,534
The docs tell you to pass NSIS_CONFIG_LOG=yes to scons as a parameter.

Anyway, we don't support mixing different versions. If you want NSIS 3 you also have to find stubs and plugins that match the exact version. If you don't care about Unicode you could compile 2.xx instead I guess.

Not sure why the JDK would trigger this, we don't use Java at all.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 19th May 2022, 21:34   #3
pkonduru
Member
 
Join Date: Jul 2015
Posts: 86
Thank you Anders for the reply. This code has remained unchanged for over 2 years now. I am trying to debug why it wouldn't generate a log suddenly now. I will certainly try to pass that parameter and keep the NSIS versions similar and see how it goes.
pkonduru is offline   Reply With Quote
Old 25th May 2022, 05:35   #4
pkonduru
Member
 
Join Date: Jul 2015
Posts: 86
Error building the nsis src from 2.46

Hi Anders,

So I changed the code to use nsis 2.46, so this is what I am basically doing:
The {docker_image_nsis_thirdparty_zip} is basically my nsis-2.46.zip with the logging build. the {docker_image_nsis_src_download_url} is the url for the nsis-2.46 source code that I get from here:
https://jaist.dl.sourceforge.net/pro...46-src.tar.bz2

COPY {{ docker_image_nsis_thirdparty_zip }} /tmp/
RUN mkdir /tmp/nsis &&\
yum install -y ca-certificates &&\
wget {{ docker_image_nsis_src_download_url }} -P /tmp/nsis/ &&\
yum install -y scons glibc-devel glibc-devel.i686 &&\
unzip /tmp/{{ docker_image_nsis_thirdparty_zip }} -d /usr/local/nsis/ &&\
tar -xvf /tmp/nsis/{{ docker_image_nsis_src_download_url|basename }} -C /usr/local/src/ &&\
mv /usr/local/src/nsis-* /usr/local/src/nsis &&\
cd /usr/local/src/nsis &&\
echo "#define NSIS_CONFIG_LOG" >> /usr/local/src/nsis/Source/exehead/config.h &&\
scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_LOG=yes NSIS_CONFIG_CONST_DATA_PATH=no PREFIX=/usr/local/nsis/bin install-compiler &&\
ln -s /usr/local/nsis/bin/makensis /usr/local/bin/makensis &&\
yum clean all &&\
rm -rf /var/cache/yum &&\
rm -rf /tmp/*


When I run this on RHEL, this is the error I get, when running the scons command:

g++ -o Source/ResourceVersionInfo.o -c -Wno-non-virtual-dtor -Wall -O2 -m32 "-DNSISCALL= __attribute__((__stdcall__))" -D_WIN32_IE=0x0500 -Ibuild/release/config Source/ResourceVersionInfo.cpp
g++ -o Source/script.o -c -Wno-non-virtual-dtor -Wall -O2 -m32 "-DNSISCALL= __attribute__((__stdcall__))" -D_WIN32_IE=0x0500 -Ibuild/release/config Source/script.cpp
In file included from Source/script.cpp:22:0:
Source/util.h: In instantiation of 'void __free_with_close:perator()(T&) [with T = int]':
Source/util.h:114:32: required from 'ResourceManager<_RESOURCE, _FREE_RESOURCE>::~ResourceManager() [with _RESOURCE = int; _FREE_RESOURCE = __free_with_close]'
Source/script.cpp:6460:1: required from here
Source/util.h:128:59: error: 'close' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
template <typename T> void operator()(T& x) { freefunc(x); } \
^
Source/util.h:145:1: note: in expansion of macro 'RM_DEFINE_FREEFUNC'
RM_DEFINE_FREEFUNC(close);
^
In file included from Source/script.cpp:46:0:
/usr/include/unistd.h:353:12: note: 'int close(int)' declared here, later in the translation unit
extern int close (int __fd);
^
scons: *** [Source/script.o] Error 1
scons: building terminated because of errors.
pkonduru is offline   Reply With Quote
Old 25th May 2022, 11:01   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,534
2.46 is 13 years old and not something we support nor recommend using, especially if you don't pair it with a compiler from the same era. I'll try to look at the code later but perhaps it's time to move to 3.x?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 25th May 2022, 15:24   #6
pkonduru
Member
 
Join Date: Jul 2015
Posts: 86
I will try to upgrade nsis to a newer version 3.x and retry the same scenario.
pkonduru is offline   Reply With Quote
Old 26th May 2022, 01:26   #7
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,534
Quote:
Originally Posted by pkonduru View Post

When I run this on RHEL, this is the error I get, when running the scons command:
Try adding

#include <unistd.h>

near the top of /Source/util.h after the other #includes...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 26th May 2022, 04:27   #8
pkonduru
Member
 
Join Date: Jul 2015
Posts: 86
Thank you Anders, I tried that but it gave this error.
First, here is my script:

COPY {{ docker_image_nsis_thirdparty_zip }} /tmp/
RUN mkdir /tmp/nsis &&\
yum install -y ca-certificates &&\
wget {{ docker_image_nsis_src_download_url }} -P /tmp/nsis/ &&\
yum install -y scons glibc-devel glibc-devel.i686 &&\
unzip /tmp/{{ docker_image_nsis_thirdparty_zip }} -d /usr/local/nsis/ &&\
tar -xvf /tmp/nsis/{{ docker_image_nsis_src_download_url|basename }} -C /usr/local/src/ &&\
mv /usr/local/src/nsis-* /usr/local/src/nsis &&\
cd /usr/local/src/nsis &&\
echo "#define NSIS_CONFIG_LOG" >> /usr/local/src/nsis/Source/exehead/config.h &&\
echo "#include <unistd.h>" >> /usr/local/src/nsis/Source/util.h &&\
scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_LOG=yes NSIS_CONFIG_CONST_DATA_PATH=no PREFIX=/usr/local/nsis/bin install-compiler &&\
ln -s /usr/local/nsis/bin/makensis /usr/local/bin/makensis &&\
yum clean all &&\
rm -rf /var/cache/yum &&\
rm -rf /tmp/*


This is the error I get:

g++ -o Source/script.o -c -Wno-non-virtual-dtor -Wall -O2 -m32 "-DNSISCALL= __attribute__((__stdcall__))" -D_WIN32_IE=0x0500 -Ibuild/release/config Source/script.cpp
In file included from Source/script.cpp:22:0:
Source/util.h: In instantiation of 'void __free_with_close:perator()(T&) [with T = int]':
Source/util.h:114:32: required from 'ResourceManager<_RESOURCE, _FREE_RESOURCE>::~ResourceManager() [with _RESOURCE = int; _FREE_RESOURCE = __free_with_close]'
Source/script.cpp:6460:1: required from here
Source/util.h:128:59: error: 'close' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
template <typename T> void operator()(T& x) { freefunc(x); } \
^
Source/util.h:145:1: note: in expansion of macro 'RM_DEFINE_FREEFUNC'
RM_DEFINE_FREEFUNC(close);
^
In file included from Source/util.h:159:0,
from Source/script.cpp:22:
/usr/include/unistd.h:353:12: note: 'int close(int)' declared here, later in the translation unit
extern int close (int __fd);
^
scons: *** [Source/script.o] Error 1
scons: building terminated because of errors.
pkonduru is offline   Reply With Quote
Old 26th May 2022, 18:28   #9
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,534
Echo >> will append? It needs to be at the top of the file.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 26th May 2022, 18:34   #10
pkonduru
Member
 
Join Date: Jul 2015
Posts: 86
Thank you Anders, I will add it at the beginning and let you know how it goes
pkonduru is offline   Reply With Quote
Old 26th May 2022, 19:36   #11
pkonduru
Member
 
Join Date: Jul 2015
Posts: 86
error log

I added the line at the beginning using this:

sed -i '17i#include <unistd.h>' /usr/local/src/nsis/Source/util.h

basically add at line 17 where the file starts after the comments.
This is the errors I got. I am attaching afile with the errors as it is not letting me post it as text.
Attached Files
File Type: txt nsis-err.txt (15.4 KB, 72 views)
pkonduru is offline   Reply With Quote
Old 1st June 2022, 04:00   #12
pkonduru
Member
 
Join Date: Jul 2015
Posts: 86
Hi Anders,
I upgraded my nsis to 3.08 and everything went fine while building the source code on linux using scons. But when I am building my .nsi file on the linux machine this is the error that I see. Any pointers on what can be done?

$ makensis -V3 -DVERSION_MAJOR=$VERSION_MAJOR -DVERSION_MINOR=$VERSION_MINOR -DVERSION_RELEASE=$VERSION_RELEASE -DBUILD_NUMBER=$CI_PIPELINE_ID -DEXTERNAL_VER="$EXTERNAL_VER" -DINSTALLER_EXT_VER="$INSTALLER_EXT_VER" $CI_PROJECT_DIR/WI/FoundationSetup.nsi
Error: reading stub "/usr/local/nsis/Stubs/zlib-x86-unicode"
Error initalizing CEXEBuild: error setting default stub


By the way this what I have done to build nsis on linux:
Where {docker_image_nsis_thirdparty_zip } is the nsis-3.08 build with the logging components inside.
{ docker_image_nsis_src_download_url } is where I get the source code for nsis-3.08 from:
https://jaist.dl.sourceforge.net/pro...08-src.tar.bz2


COPY {{ docker_image_nsis_thirdparty_zip }} /tmp/
RUN mkdir /tmp/nsis &&\
yum install -y ca-certificates &&\
wget {{ docker_image_nsis_src_download_url }} -P /tmp/nsis/ &&\
yum install -y scons glibc-devel glibc-devel.i686 &&\
unzip /tmp/{{ docker_image_nsis_thirdparty_zip }} -d /usr/local/nsis/ &&\
tar -xvf /tmp/nsis/{{ docker_image_nsis_src_download_url|basename }} -C /usr/local/src/ &&\
mv /usr/local/src/nsis-* /usr/local/src/nsis &&\
cd /usr/local/src/nsis &&\
echo "#define NSIS_CONFIG_LOG" >> /usr/local/src/nsis/Source/exehead/config.h &&\
scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_LOG=yes NSIS_CONFIG_CONST_DATA_PATH=no PREFIX=/usr/local/nsis/bin install-compiler &&\
ln -s /usr/local/nsis/bin/makensis /usr/local/bin/makensis &&\
yum clean all &&\
rm -rf /var/cache/yum &&\
rm -rf /tmp/*

Last edited by pkonduru; 1st June 2022 at 05:21.
pkonduru is offline   Reply With Quote
Old 1st June 2022, 16:22   #13
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,534
To ask a stupid question, does "/usr/local/nsis/Stubs/zlib-x86-unicode" exist? If not then you need to grab those files from https://sourceforge.net/projects/nsi...-fra&download= (https://nsis.sourceforge.io/Special_Builds#)

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 1st June 2022, 18:16   #14
pkonduru
Member
 
Join Date: Jul 2015
Posts: 86
aah, I see what you are saying, basically in the nsis-3.08-log.zip there is no separate folder zlib-x86-unicode. All the files are under Stubs. Should I create a folder zlib-x86-unicode and put all the unicode files in there?
or are you asking if that file exists? It does exist in my stubs folder.
pkonduru is offline   Reply With Quote
Old 1st June 2022, 19:13   #15
pkonduru
Member
 
Join Date: Jul 2015
Posts: 86
Do you think I should add these to the SCONS command "build_static=1 build_dynamic=0 UNICODE=yes"?
pkonduru is offline   Reply With Quote
Old 1st June 2022, 19:34   #16
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,534
zlib-x86-unicode is a filename. The files in the .zip stub folder go in the stubs folder /usr/local/nsis/Stubs. The stubs and plug-ins are not built because you are asking scons not to build them (not unusual on linux but you still need the file from somewhere).

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 1st June 2022, 22:14   #17
pkonduru
Member
 
Join Date: Jul 2015
Posts: 86
I do have the file under usr/local/nsis/stubs. I think the prefix directory that I pass to scons usr/local/nsis/bin the directory was not correct. When I unzipped the 3.08.zip it created another folder 3.08 and contents are under that. So basically there is nothing under usr/local/nsis/bin but under /usr/local/nsis/3.08/bin does. Let me update my script and see how it goes.
thank you for your help Anders!
pkonduru is offline   Reply With Quote
Old 2nd June 2022, 03:25   #18
pkonduru
Member
 
Join Date: Jul 2015
Posts: 86
(solved) Finally!

Thanks Anders for the help!
The issue was that the nsis-3.08.zip when extracted was creating another sub-directory under which all the files were. Moving them to the right directory fixed it. For anyone looking to build NSIS 3.08 on linux, here's what I did. This is my ansible script but basically shell command that I ran on the linux box(RHEL).

docker_image_nsis_thirdparty_zip -- this refers to the actual nsis-3.08.zip file from the downloads.
docker_image_nsis_src_download_url --this refers to the nsis-3.08 src code from the downloads .
https://jaist.dl.sourceforge.net/pro...08-src.tar.bz2


COPY {{ docker_image_nsis_thirdparty_zip }} /tmp/
RUN mkdir /tmp/nsis &&\
yum install -y ca-certificates &&\
wget {{ docker_image_nsis_src_download_url }} -P /tmp/nsis/ &&\
yum install -y scons glibc-devel glibc-devel.i686 &&\
unzip /tmp/{{ docker_image_nsis_thirdparty_zip }} -d /usr/local/ &&\
mv /usr/local/3.08 /usr/local/nsis &&\
tar -xvf /tmp/nsis/{{ docker_image_nsis_src_download_url|basename }} -C /usr/local/src/ &&\
mv /usr/local/src/nsis-* /usr/local/src/nsis &&\
cd /usr/local/src/nsis &&\
echo "#define NSIS_CONFIG_LOG" >> /usr/local/src/nsis/Source/exehead/config.h &&\
scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_LOG=yes NSIS_CONFIG_CONST_DATA_PATH=no PREFIX=/usr/local/nsis/bin install-compiler &&\
ln -s /usr/local/nsis/bin/makensis /usr/local/bin/makensis &&\
yum clean all &&\
rm -rf /var/cache/yum &&\
rm -rf /tmp/*
pkonduru is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump