- NSIS Discussion
- Error: could not resolve label "goto" in unnamed install section (1)
Archive: Error: could not resolve label "goto" in unnamed install section (1)
youngbucks
16th May 2008 22:08 UTC
Error: could not resolve label "goto" in unnamed install section (1)
I keep on getting this error when i try to compile my finished installer and i don't know why. I searched my file with the use of the notepad "find" function and all the times "goto" is used is only in the one section. Any idea whats going on anyone?
When i put the goto command in the same line the result is:
IfFileExists expects 2-3 parameters, got 5.
Usage: IfFileExists filename label_to_goto_if_file_exists [label_to_goto_otherwise]
kichik
16th May 2008 22:18 UTC
Goto is a command and shouldn't be used with IfFileExists and others. It's a command by its own. When you're asked for a label, just a label is required with no "goto" prefix.
You should use the LogicLib for easier conditionals.
!include LogicLib.nsh
#...
${If} ${FileExists} $INSTDIR\Prerequisites\C#.msi
# do something
${EndIf}
youngbucks
16th May 2008 22:31 UTC
Ok but before i go and do this i need to 100% understand how to put that into my script because i dont want to mess it up. could you show me an example of it being used? preferably with a part of my scipt if its not too much.
Is this the proper use? If the files are not there will they still be downloaded? (See my above post for the new attachment.)
Well new problems have now arose:
1. Only the first file which is Dark.msi extracts itself and the others don't
2. The NSISdl is giving me an error and its not downloading the files. (Fixed!)
3. I don't want my nsis to be showing all the commands i type out if you get what i mean.
Heres some pics to help out:
http://img529.imageshack.us/img529/3520/78795534ks4.jpg
http://img529.imageshack.us/img529/2711/25574629rf8.jpg[B][U]
Red Wine
17th May 2008 01:46 UTC
try this:
youngbucks
17th May 2008 02:22 UTC
Thanks, im saving that script to use later on and the part where u used $OUTDIR instead of $INSTDIR helped me out because i couldnt get the installer to execute the file and that worked :) As for the rest of my problems now they are fixed. Im a beginner at this stuff so ill be here quite a bit :)
Johnm312
17th May 2008 20:13 UTC
Red,
I was looking at that script, It is nice and to the point.
my question to you, is there a way to create an ini file of all of the filenames and links i want to download and have the script go down the list and dynamically get one file at a time until it is out of files. allowing me to add more files to it on the fly to my collection of mods for a game i am working on.
youngbucks
17th May 2008 20:18 UTC
I don't think thats possible but what you can do is in your script file you add the multiple links of all the files you want to download. Look at this link for better usage
http://myweb.tiscali.co.uk/imker/afrowuk/stuff/NSISdl.nsh
. and your gonna need this file.
Johnm312
17th May 2008 20:30 UTC
thank you for the fast reply.
Unfortunately not all of the projects are on the same server. a few are even posted as attachments on a forum.
I was looking at a few sample scripts and it looks like it might be possible to read a set of fields, attach them to a var, Download the var name, then go back to the ini file.
I could be wrong.
right now i have maybe 25 downloads and i keep creating more mods. so, the list will only grow.
perhaps if it works well. maybe allow some people to add their files to the ini for a "community pack".
Edit. sorry I just looked at the file again. i opened the wrong sample. it could do what i want for myself. but it would remove the option to aloow for 3rd partys to add to the serverlist.
Red Wine
17th May 2008 20:48 UTC
You can use InetC to push in the stack all the collected links.
http://nsis.sourceforge.net/Inetc_plug-in
Johnm312
17th May 2008 21:34 UTC
Thank you for the answer,
Unfortunately i am reading though pages and pages and i am lost. unfortunately my scripting is still lacking. I can see the logic in code but trying to recreate it is.. well disaster at the moment
I have created some very complex installers recently, but right now i am just staring at a blank page lost..
{_trueparuex^}
17th May 2008 23:27 UTC
Ok here's a basic concept with the existing code. It's nothing too fancy but should do the job.
It reads the downloads from CPPackage.ini which should be in the same directory with the installer. The ini file has to be in following format.
[downloads]
message0=Do you want foo?
downloadurl0=http://google.com/foo.exe
filename0=foo.exe
message1=Do you want bar?
downloadurl1=http://google.com/bar.exe
filename1=bar.exe
...
Par
youngbucks
18th May 2008 00:15 UTC
Thanks alot ^^ ill use this for sure, right now i dont have time to be going to be mailing solutions to customers when now i can host the files with my computer and send all of them at once to them.
Johnm312
18th May 2008 01:03 UTC
Par,
That is pretty much what i had in Mind,
I was going to add directory sorting for different mod types. For example "Maps", "American Style Mods", "German Style Mods", ETC, with Your method that would be easy to variable into it.
Thank You for all for taking the time out to look into this. I really do appreciate it.
youngbucks
18th May 2008 02:14 UTC
Just tested this out and theres one problem i keep on getting. It keeps on "echoing" a command its supposed to be carrying out and i didnt put the message box script infront.
Johnm312
18th May 2008 02:30 UTC
I saw that, i rem'd it out. i did not want the files to execute anyways, just gather.
I also moved the "do you want file XXX?" message box to pop up after if it check if the file existed and to just echo the file name back at me.
I also combined:
NSISdl::download $downloadurl$filename "$OUTDIR\$filename"
so that i had less data to fill into my ini.
it is now
downloadurl0=http://google.com/
filename0=foo.exe
Edit:
I forgot I also had it grab the INI off the Download server and put it into the plugin folder so you wont have to get a new installer when I add more files to the list.
youngbucks
18th May 2008 03:52 UTC
After your done could you attach your script so i can see the proper usage?
What im planning to do with this is set up my ini files with all the dl links so that when its run if there is an update it downloads the new ini file if it doesnt detect it and downloads the new files.