Menu

#1007 MAKENSIS crash with !include

2.0 Series
closed-accepted
nobody
Scripting (211)
5
2013-03-17
2010-09-16
Anonymous
No

Compiler crashes if using nested !include to 8 levels deep and then try to use ${For} from LogicLib.

====MAIN SCRIPT====
!include LogicLib.nsh
OutFile "NESTTEST.EXE"
InstallDir $DESKTOP\Example1
RequestExecutionLevel user
ShowInstDetails show
Page components
Page instfiles
Section "nested includes test" NESTTEST
!define FILENUM "0"
!include "file1.nsh"
SectionEnd

====FILE1.NSH====
!ifdef _FILENUM
!undef _FILENUM
!endif
!define /math _FILENUM ${FILENUM} + 1
!echo `I am include number ${_FILENUM}`
!undef FILENUM
!define FILENUM ${_FILENUM}
${For} $R0 1 5
${Next}
!if ${FILENUM} < 16
!include "file1.nsh"
!endif

Last 4 lines of compiler output (before the crash) are:
I am include number 8 (file1.nsh:5)
!undef: "FILENUM"
!define: "FILENUM"="8"
!insertmacro: _For

If you take out the ${For} and ${Next} then you get:
I am include number 10 (file1.nsh:5)
!undef: "FILENUM"
!define: "FILENUM"="10"
!include: "file1.nsh"
parseScript: too many levels of includes (10 max).

So if 10 is the max, why does the ${For} statement cause a crash at 8 levels?

NSIS 2.46 standard build.

Discussion

  • Anders

    Anders - 2013-03-17

    Thanks, fixed.

     
  • Anders

    Anders - 2013-03-17
    • labels: --> Scripting
    • status: open --> closed-accepted
     

Log in to post a comment.