grahama
7th January 2005 01:01 UTC
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 ?
Comperio
7th January 2005 06:58 UTC
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)
grahama
7th January 2005 22:26 UTC
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
Comperio
8th January 2005 06:13 UTC
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.
kichik
8th January 2005 12:20 UTC
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.
grahama
10th January 2005 16:17 UTC
moving around the !include fixed the problem :)
I put it at the beginning of my Functions