Archive: .NSH with nested !include question...


.NSH with nested !include question...
I have begun to break out a fair amount of code into "Helper Libraries" using .nsh files because my latest installer is over 1500 lines and much of it can be re-used in future installers. With that said, I'm having a problem with nested !includes.

The main .nsi file has a !include for "FileFunc.nsh" as well as one of my custom .nsh files. When I compile I get an error:

!define: "FILEFUNC_VERBOSE" already defined!
!include: error in script: "C:\Program Files\NSIS\Include\FileFunc.nsh" on line 82
!include: error in script: "MSILibrary.nsh" on line 6

I'm clearly doing something wrong. What is the correct way to have a common .nsh file included in multiple files?

I may break these libraries out further to even more descrete tasks so there may be a .nsh file !including another .nsh file and both sharing a common .nsh file.

As an aside: This is kinda why I created a post earlier about "Best Practices" for larger installer cause I knew I'd screw this up... :)

Thanks in advance.


A common error when !include headers is if you !include first a header that uses another one.
e.g.
!include "myheader.nsh" ;this header uses LogicLib
!include "LogicLib.nsh"
this is wrong, should be:
!include "LogicLib.nsh"
!include "myheader.nsh"


http://forums.winamp.com/showthread....17#post1938017


Thank you Red! - I didn't know that. I made the changes you suggested but it didn't solve this particular problem, but at least I know going forward.

Thank you Instructor! - The corrected versions of the .nsh files in the link you provided did the trick!

I take it this will be in the next update of NSIS...

Thanks again.

jc3