Archive: strange !include problem


strange !include problem
I just started separating my code into separate files like DefinesAndVars.nsh and myFunctions.nsh . For some strange reason when I... !include myFunctions.nsh in my main .nsi file, I get the error:
Error: invalid script: no sections specified.
Well, there are no sections in myFunctions.nsh because it is just a bunch of functions... ;)
I just started separating out my code so it is probably something stupid...
Using only !include DefinesAndVars.nsh by itself does work
anyone know ?


you have to include at least a section and an ouput file.
Like this:

OutFile "somefile.exe"

Section sectionname
SectionEnd

(More info on script setup can be found in the help files)


I have to do this for an .nsh file ? I have a main .nsi file that has all the section stuff...and the includes...
as far as I know you can not even compile an .nsh file.
I'll throw in a dummy section with nothing in it and see if that works...
many thanks
g


One additional thought:

I've found that the order in which the various fuctions, sections, commands, etc. appear in the files is critical.

Perhaps you have some extra commands in your NSH files that is "confusing" the compiler (in a manner of speaking). Or, it could be simply the placement of your !include statements in the main NSI file. (I like to put mine near the top of the file).

Hope this helps.


Since include simply copies the contents of the file into the !include position, I'd suggest you manually do the same. You will then have one .nsi file in which it'll be easier to see what's wrong.


moving around the !include fixed the problem :)
I put it at the beginning of my Functions