Archive: Another question


Another question
I'm going to make up an updates program for our Quake2 D-Day: Normandy mod, and I am wondering if it is possible for my program to download all kinds of files off a webserver.

This might be just standard .txt files, or maybe in someother puretext format (I'm currently unsure)

This isn't for the purpose of downloading the updates, but is for getting the list of updates which we can update using php onto their local computer. My program can then use that list.

-Stu


Can be downloaded any type of file (with NSISdl plugin). In my program (for example), I download .zip and .ini files to upgrade it.


Good good!
In my experiance, I was thinking NSISdl would not when it would not download from links like this:

http://myweb.tiscali.co.uk/afrowuk/downloads.php?id=102

This won't work with NSISdl, sine it hasnn't got any file extension on the end.

-Stu


That's not true. NSIS Update uses NSISdl to check for updates, it's also a PHP page. Maybe you did not send the required headers, what is the error message?


Here's what I have right now:


StrCpy $R1 0
updateloop:
IntOp $R1 $R1 + 1
StrCmp $R1 10 0 +2
Quit

ReadINIStr $R0 "$EXEDIR\settings.txt" "Settings" "MasterServer"

NSISdl::download $R0 "$TEMP\ddayupdater\main\updates.txt"
Pop $R0
StrCmp $R0 "success" +3
MessageBox MB_OK "Error: Not connected to internet,$\nor the updates MasterServer is down."
Goto updateloop


The address it reads out of the INI file is http://myweb.tiscali.co.uk/afrowuk/d...es/updates.txt

You click on that link and it will load fine, but if I try and download it like the code shows, it just fails.

What's wrong?

-Stu

Ok, I founf the problem. I have to create the directory before hand and then it will download to that directory.

It would be nice if NSISdl would work without having to specify a SaveAs path / file, since you may be downloading from one of those php links I described above, you won't know what the file name or extension will be, so therefore you cannot do a SaveAs.

-Stu


Create the subfolder $TEMP\ddayupdater\main\ before downloading.

[EDIT]I posted some minutes after Afrow UK found the answer! (beat by the time):) [/EDIT]


Afrow, you can create another PHP script that will output the name of the file and use it as the path to save the file with the second download.