Skip to content
⌘ NSIS Forum Archive

http + ftp download plug-in

545 posts

Yurik#
Takhir,
is it possible to set proxy settings (proxy/port/user/password) for your plugin inside the NSIS script?
Thanks
Takhir#
Proxy authorization support added. New command line options:

/PROXY IP:PORT - overwrites current proxy settings, not required in most cases, because IE settings will be used by default.
/USERNAME LOGIN - proxy username
/PASSWORD PASSWD - proxy password

For example
InetLoad::load /PROXY 55.55.55.55:8080 /USERNAME nick /PASSWORD jagger ....

BTW URL can also include target server login/password, CrackUrl function recognizes it, something like this (remove spaces after : , :+p= 😛 ) : http://username: password@www.whatever.com/secret/eyesonly.htm

Many thanks to Yurik for tests.
Takhir#
I have few similar requests, so new option:
/POPUP PREFIX
sets first part of the popup dialog caption (prefix), for example
/POPUP "Some text"
displays:
Some text - Connecting...
You cannot skip this parameter, but can use
/POPUP ""
for default ("InetLoad plug-in").
kichik#
I have tested the plug-in on Windows XP SP2. The HTTP download went well, but the FTP download failed. I have Windows Firewall turned on and it popped up a message asking me if I want to allow the installer to connect. InetLoad gave me an error message before I could unblock it. When I tried it again, after it was unblocked, it just failed with the same error message - "Open URL Error". The URL in the example seems OK. I was able to open it using Firefox.
Takhir#
Now I work on XP Pro SP2 too, new project http://www.modya.com requires this 🙁
MS Firewall bihaviour is so strange 🙂 I deleted InetLoad from exclusions list, firewall popuped "restricted access" dialog, but I could see on the NSIS window under this dialog (I not closed it) that 25 MB download was continued and finished with OK status ...
Nevertheless, first question - MS Firewall connection error, simple patch: /RESUME "" option, I re-tested this, plug-in popups messagebox and continued download attempts after I clicked "Retry". Better way - specific firewall error, this case plug-in can auto-enable resume option (if install is not 'silent'). I wrote above that I could not reproduce situation, so KichiK please test attached dll, it should display messagebox with lasterror and InternetGetLastResponseInfo (if any). The only code I saw in the similar situations earlier with other programs was 12002 (when Firewall threated conection as virus atack).
Second question - InetLoad is in the Firewall list, but still connect error occure - no ideas right now..
kichik#
I didn't get any new message box using the attached DLL. Still the same "Download Status: Open URL Error". I should have included the "Download Status:" part in the last message. It seems the download does start because it updates the file size field (17kb). But then the firewall dialog opens and the failure message pops up.
Takhir#
Attached version supports 😉
InternetSetOption flags include few timeout parameters, but I guess connect is what you want.
Also:
1. ftp client works in the passive mode, all modern servers support this.
2. On firewall error plug-in (if not in the silent mode) auto-enables Resume option and displays message box, so user can solve firewall problem and click Retry.
delboy#
Really cool, will set about updating our installers!
Quick question - when i used NSISDL i hacked together a method of allowing the user to quit out of the installer and pick up the download when they reran it (not very pretty but it helps for people downloading large files over dial up)
Is there a way of doing this more elegantly using the retry functionality you have in here (ie is there some way of persisting the status of download and picking it up again)?
Takhir#
1. If connection to server was lost, but some data were received during last session, plug-in makes a short pause, reconnects and continues download from the current position. A some kind of re-get.
2. If /RESUME "" option set, plug-in on any error except "file not found" first asks user (retry-cancel), this helps on dial-up connection and firewall problems.
2.5 On GetLastError()==12002 or 12003 (in most cases firewall related) plug-in auto-enables /RESUME option, but please note that english default text will be used in the message box (many thanks again to Stu from Shropshire for the great text 🙂 ).
Finally plug-in returns "OK" or error description string (full set of strings in the InetLoad.cpp file), so on error you can ask user again or terminate installation. You can find all plug-in command line options in the Readme.txt (including 3 display modes).
I hope all these tricks may help to solve some common download problems 🙂
delboy#
Hi Takhir, Is persisting the download session possible, such that a user may actually quit out of the installation and on the next run auto resume the download? obviosuly the logic behind this would be in the nsis script itself, but its more a question of how easy it would be to have say a retry now retry later and cancel options on that connection failure box.
seniorquico#
I've got an interesting problem with Inetload. I haven't really found any info on something like this, but I've been scratching my head for a few hours and I just can't seem to figure it out. I copied the Inetload command from the example in the plugin archive and added a file of my own on a new command right after it, just like so (on multiple lines to try not to break page's design):
InetLoad::load /POPUP "http://www.dreamgirlswallpaper.co.uk/
fiveyearsonline/wallpaper/Cameron_Diaz/camerond09big.JPG"
"$EXEDIR\cd.jpg"
InetLoad::load /POPUP "ftp://my_server/patches/patch1.exe" "$EXEDIR\patch1.exe"
The above code WORKS without any problems. But now the interesting thing (at least to me), the moment I delete the first line, the Cameron Diaz pic dl, the whole thing stops working! To be more specific, the installer downloads the file just like it did previously, but as soon as it obtains the file, the installer crashes! I started to play around with this some more, and I further came to the conclusion that if I even change the Cameron Diaz pic to ANYTHING else, the installer crashes after obtaining the files. Now, I don't know if this is a cruel joke to make us all download that file, but I really can't figure this problem out. But, I'm just a "simple" web programmer so what do I know about these complex NSIS scripts and plugins. Any help would be GREATLY appreciated.
Takhir#
First of all if you are using latest plug-in version, popup parameter includes 'prefix' text, to use default it should be /POPUP ""
Code above should not work because first download result - 'OK' string (from Cameron 🙂 ) is in the stack yet, please use Pop $1 (for example) after every download to clean stack. Otherwise 'OK' string will be first parameter for the next plug-in call. If you are using stack for other vars, use /END parameter (see Readme) to stop plug-in's stack reading at the end of this command line. Plug-in also supports few downloads from one command line.
And now some single ftp download, re-tested:

Section "Dummy Section" SecDummy

InetLoad::load /POPUP "Readme.txt from MS FTP" "ftp://ftp.microsoft.com/MISC/ReadMe1.txt" "$EXEDIR\rm.txt" /END
Pop $0 # return value = exit code, "OK" if OK
MessageBox MB_OK "Download Status: $0"

SectionEnd
Status 'OK', file looks correct too. I aslo tested big ftp download with login😛assword in the LAN, and not found any problems. And I hope that bad syntax only might cause crash 🙂
Takhir#
http and ftp only. rtsp(tcp) - no, rtsp over http - I am not sure, but if you want (and can) save all content to file (using http as transport) - may be (not tested). But please note, http and ftp support GET method only. Probably the same with mms.
Takhir#
CrackUrl() string buffers length bug fixed (256->NSIS string_size).
Afrow UK#
Hey Takhir, just wondering why with InetLoad I only get a maximum of 30kbps download speeds on all servers when through browsers I usually get 80-120kbps.

Other people have the same problem too.

Edit: Same problem with NSISdl too 🙁

-Stu
Afrow UK#
I was wondering if you could implement the NXS progress banner into InetLoad, so we could have just a simple progress bar when downloading small files between pages.

Also, how easy would it be to write a BitTorrent plugin that works. I've tried the one on the archive (written in Python) but it doesn't seem to work at all.
The actual example is very poor too.

-Stu
Afrow UK#
Now I'm trying to get InetLoad to execute a PHP script on the internet. Everytime it says File Open Error, when the script is executed fine through my browser.
I've even tried setting the Content-length header and then it works in NSISdl, but still not with InetLoad.

I tried the post example script you made, but that doesn't work for me either. I'm wondering if it's the server, but if it works with NSISdl then surely it can't be...

Please help 🙁

Edit: LOL now it's working. Because I'm using CallInstDLL to call the plugin, I had the URL and local file Push order swapped 😛

-Stu
Jnuw#
Originally posted by Afrow UK
Hey Takhir, just wondering why with InetLoad I only get a maximum of 30kbps download speeds on all servers when through browsers I usually get 80-120kbps.

Other people have the same problem too.

Edit: Same problem with NSISdl too 🙁

-Stu
Stu, I just tested it on my work PC, i was getting around 1360kbps which is about 90% of our T1. I'm using the InetLoad from 3/3/05, which is probably this one. Hope this helps.

Jnuw
tbrandner#
Long 50 second delay after download

Wow, inetload is a great plug-in!

I have a packaged installer that grabs a file over the 'net, and it's working great aside from a small problem that happens after a successful download.

After a successful download, there is about a 50 second delay before the installer continues. I've put message box popups at each step of the installer, and the delay is immediately after the inetload:load command.

Any idea where this delay is coming from? It doesn't seem to have anything to do with the size of the download...?

Thanks,

Tony
Takhir#
Now I am online again and I'll check all problems tomorrow.
tbrandner: I saw delay on the plug-in exit (cannot remember precisely when & where), but this happened after last plug-in operator (probably in the NSIS code). Can you give me script sample?
Afrow UK: last version worked with my office 8 Mbit/sec line. I can test script sample if required. And I need to understand bittorent protocol first, I'll try 🙂
Afrow UK#
It's ok Takhir, thanks to immadster the author of XBTT http://sourceforge.net/projects/xbtt/ has agreed to make a BitTorrent plugin for NSIS.

Not sure exactly how long it will take though.

-Stu
Yathosho#
i'm just switched from NSISdl to InetLoad, as NSISdl does not support URL encoded login/password. i'm using a function that reads a set of URLs from a text-file and downloads one file after another. i experienced that InetLoad uses to crashes my installer quite often, without a recognizable pattern.

edit: this only seems to happen when running InetLoad in a loop. when i downloaded 10 files with 10 InetLoad commands i experience no problems. any fix or workaround?
Takhir#edited
Yathosho: This may be blank space in the URL or \r - \n at the end of line. I can fix, but I'd like to understand the problem first. Script sample? 🙂
Afrow UK: Just tested SP download 130 MB - 13 sec in the 100 Mb LAN.
Takhir#
Originally posted by Afrow UK
I was wondering if you could implement the NXS progress banner into InetLoad, so we could have just a simple progress bar when downloading small files between pages.


Following "banner" mode has not Cancel button (but Esc key works):

/BANNER CAPTION TEXT

For example:
InetLoad::load /banner "Cameron Diaz" "coming soon" "ftp://...."

I cannot remeber right now why I removed x button from the banner dialog, but I can put it back 🙂
Afrow UK#
Yathosho I couldn't find anything related on that link...

And thanks for the banner Takhir, I'll have a look at that now.

Edit: Oh it doesn't have a progress bar though. I've already got a banner showing but a progress bar would be nice too.

-Stu