Skip to content
⌘ NSIS Forum Archive

Nestable !insertmacro?

1 posts

eccles#

Nestable !insertmacro?

Welcome back Justin...!

The documentation states that !insertmacro can be used inside another !macro definition -
Note that macros cannot contain other macro definitions (though they can insert other macros).
However, the compiler won't let me do this 🙁 -
!insertmacro: cannot be called in command/macro mode
Well, I hacked the source to remove the error message, to try it, and everything seems to be working as expected... Can you confirm?

I've been trying to do things like -
  ; Big list created by batch file...
!define FNAME "file0123.xxx"
!define FTYPE X
!insertmacro DoFile
!define FNAME "file0124.xxx"
!define FTYPE Y
!insertmacro DoFile

...

!macro DoFile
!insertmacro DoFileCommonStuff
!insertmacro DoFileType${FTYPE}
!undef FNAME
!undef FTYPE
!macroend
Thanks!

--
Dave.