Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 11th March 2020, 23:20   #1
sereeena
Junior Member
 
Join Date: Mar 2020
Posts: 4
Sections not visible in components page with nsis v3.05 built on debian

Hi, I really like NSIS so this is driving me mad that I should be able to display multiple sections as components, but whatever I do, only the first section shows up (the others are not even unchecked they are simply not there!).

I don't know if there is something wrong with my build of makensis, I wanted to build in my CI pipeline so I followed this post https://www.conjur.org/blog/building...x-ci-pipeline/ and have built nsis v3.05 compiled from source in a docker container, I used their compiled dockerfile but with v3.05 instead of v3.03.

Here is my nsis script:

!include MUI2.nsh
!include Sections.nsh

OutFile "Installer.exe"
Unicode true
Name "Test"
InstallDir "$PROGRAMFILES64\Test"

;--------------------------------
;Pages

!define MUI_COMPONENTSPAGE_NODESC
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "English"

Section aaa s1
SectionEnd

Section /o bbb s2
SectionEnd

Section ccc s3
SectionEnd

Function .onInit
SectionSetFlags ${s2} 17
SectionSetFlags ${s3} 17
FunctionEnd

And you can see from my screenshot (run on Windows 10 64bit VM) that we only see aaa in the components page.
I have tried using SectionIn and SectionInstType as well, but even if I didn't use the .onInit function I would expect to see the other sections in the components page as they are not hidden sections?

Please advise? Thanks, Serena
Attached Thumbnails
Click image for larger version

Name:	screenshot.jpg
Views:	60
Size:	60.4 KB
ID:	54530  
sereeena is offline   Reply With Quote
Old 12th March 2020, 12:10   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,281
Very strange.

We generally don't recommend that you call SectionSetFlags directly.

Are these invisible sections executed? If you put a MessageBox in them, do they pop up?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 12th March 2020, 22:45   #3
sereeena
Junior Member
 
Join Date: Mar 2020
Posts: 4
Yes I agree, very strange, I would like to get it working to use multiple components in an installer!

The following sections aren't called, I have tried putting message boxes in them, only the first section is ever executed, regardless of whether the first one is a hidden or named section.

I was just trying Sections.nsh/SectionSetFlags to see if it would help, I have the same problem without it, and as I said I have also tried using SectionIn or SectionInstType with InstType as well.

Can you confirm this shouldn't be a problem with my script in v3.05?

Can anyone see a problem with the build of nsis in my Dockerfile? I have attached it (I had to rename it .txt for upload but it should just be Dockerfile), I build it with
docker build -t <imagetag> .

then, in the directory with nsis script in it, attach a volume to the docker container pointing to this directory <hostpath>, and pass it to docker container which will build the installer in this directory
docker run -it -v <hostpath>:/installer test.nsi

Then I try the resulting installer on a real Windows 10 Home 64 bit machine and only see the first section.

Please let me know if anyone has ideas of anything I can try, thanks
Serena
Attached Files
File Type: txt Dockerfile.txt (1.4 KB, 62 views)
sereeena is offline   Reply With Quote
Old 12th March 2020, 23:56   #4
sereeena
Junior Member
 
Join Date: Mar 2020
Posts: 4
Ah, I found it was a problem with the nsis build of 3.05 in the dockerfile!

Although I don't know what is wrong with the Dockerfile which tries to build v3.05 from sources, I saw in your forum post http://forums.winamp.com/showthread.php?t=395732
that there is a stable v3.04 build on debian buster - I was only trying to compile it because I didn't want to use old v2.5 versions that most linux distributions are stuck with.

Using a docker container using buster with nsis installed, everything works perfectly, thanks!
sereeena is offline   Reply With Quote
Old 13th March 2020, 03:09   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,281
It should obviously work with 3.05 as well. It would be interesting to find out if the issue is with the compiler or the stub. There was a small section related change in 3.05 but I don't think it changed the stubs at all.

Things to try in 3.05:

Use !verbose 4 in the script and see if the compiler prints a message for the sections. The statistics at the end should have a section count as well.

Use the working stub files from 3.04 with the 3.05 compiler (this might crash, stubs are not always compatible with other versions).

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 16th March 2020, 04:29   #6
sereeena
Junior Member
 
Join Date: Mar 2020
Posts: 4
OK, I found the error and it was due to the compilation, it was this line:

code:
RUN scons NSIS_MAX_STRLEN=8192 NSIS_CONFIG_CONST_DATA_PATH=no SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all PREFIX=/nsis/nsis-$NSIS_VERSION install-compiler


The NSIS_MAX_STRLEN=8192 should not be there, then v3.05 is built and works perfectly. (Or it should be possibly downloading nsis-3.05-strlen_8192.zip instead of nsis-3.05.zip, I didn't try this)

It's great that buster has v3.04 but this will be handy to build future versions of NSIS under linux!
sereeena 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