Old 18th December 2004, 14:47   #41
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Might be better to give me test script, but I did some changes - redraw not tested.
1006 redraw (RedrawWindow(with erase background))
Downloading ...
Connecting now appears at the beginning of download.
Attached Files
File Type: zip inetload.zip (17.2 KB, 874 views)
Takhir is offline   Reply With Quote
Old 18th December 2004, 19:50   #42
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
The problem is still there with the overlapping text.
Compile this example; it shows the problem.

-Stu
Attached Files
File Type: nsi inetload_test.nsi (310 Bytes, 897 views)
Afrow UK is offline   Reply With Quote
Old 19th December 2004, 06:47   #43
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Updated. Tested on Win98 SE and WinXP Pro.
And I still hope that InetLoad sounds better then NSISdl
Attached Files
File Type: zip inetload.zip (17.4 KB, 763 views)
Takhir is offline   Reply With Quote
Old 19th December 2004, 13:28   #44
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Works beautifully, well done!
I will convert my installer over to InetLoad

-Stu
Afrow UK is offline   Reply With Quote
Old 19th December 2004, 14:23   #45
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Ok, I found some really dodgy weird bug.

If I Push two things onto the stack before calling InetLoad, InetLoad always fails and returns either "File Open Error" or "URL Parts Error".
InetLoad returns "File Open Error" if I have two empty strings ("") onto the stack, and "URL Parts Error" if I have two non-empty strings on the stack (ie "blah").
If I Pop one of them off immediately, InetLoad works as normal!
It seems that if I have more than one item on the NSIS stack, InetLoad fails.

This example shows the problem...
Compile it and you'll get the problem straight away.

Edit: Have you got code in there to read the URL and the save-to-file from the stack? Nothing in the readme about it!!!
And it's not reading from the top of the stack either, more like either at the bottom of somewhere in-between!

-Stu
Attached Files
File Type: nsi inetload_test.nsi (326 Bytes, 860 views)
Afrow UK is offline   Reply With Quote
Old 19th December 2004, 14:33   #46
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Could you just remove the stack support? For some reason because I'm using the stack a lot in this installer InetLoad messes the stack up completely (it seems to move things on the stack around!)

-Stu
Afrow UK is offline   Reply With Quote
Old 19th December 2004, 14:38   #47
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
If I Push this onto the stack first:
"ja"
"ja"
"$EXEDIR\GameVer.muf"
"http://myweb.tiscali.co.uk/imker/Updater/Games/hostile.gdf"
""
"$EXEDIR\GameVer.muf"
"http://myweb.tiscali.co.uk/imker/Updater/Games/hostile.gdf"

Then I call InetLoad, the stack becomes just:
"ja"

Definately something strange going on there

-Stu
Afrow UK is offline   Reply With Quote
Old 19th December 2004, 14:43   #48
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
This is not a bug, Kichik asked to add multiple files support, as many as plug-in can find in stack. This is why plug-in reads stack till the bottom. If plug-in cannot read both URL and file_name (one string presents), it exits with OK code, but if 2 strings comes from stack and one is not URL or another is not a valid file path - it fails with some code.
And one more redraw of 1006 control on exit added, sorry, it's for 'Completed'.

Last edited by Takhir; 19th December 2004 at 14:59.
Takhir is offline   Reply With Quote
Old 19th December 2004, 14:59   #49
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You need something in the plugin to check when the URL's Pushed on to the stack end. E.g.

Push "start urls"
Push "url 1"
Push "save to"
Push "url 2"
Push "save to"
InetLoad::Load /SILENT

InetLoad just needs to keep Popping off the stack until it finds the string "start urls" (or something).
Currently it's Popping everything off the stack in case that it's another download URL. This is silly because we might need to use the stack for other strings as well. We call InetLoad and after that they're all gone!

Edit: I don't think Kichik told you, but this has to be the default behaviour. Check out all the NSISdl macro's on the archive which do exactly the same thing...

-Stu
Afrow UK is offline   Reply With Quote
Old 19th December 2004, 15:28   #50
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
I can add /END parameter for such situations, for example

Push "bla"
InetLoad::load /POPUP "http://myweb.tiscali.co.uk/imker/Updater/Games/hostile.gdf" "$EXEDIR\GameVer.muf" /END
Pop $R0
MessageBox MB_OK $R0
Pop $R0
MessageBox MB_OK $R0
Second MessageBox says "bla" in my test
Attached Files
File Type: zip inetload.zip (17.5 KB, 794 views)
Takhir is offline   Reply With Quote
Old 19th December 2004, 15:49   #51
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Ah very cool!

I will try it out in a few minutes (when my map finishes compiling).

-Stu
Afrow UK is offline   Reply With Quote
Old 19th December 2004, 15:54   #52
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Just curious then... How does the plugin know whether to get the URL's from the stack or from the command-line. If no extra params exist on the command-line then it reads from the stack?

If it reads from the stack, then how does it know when to stop?
I might think about using the stack to pass multiple URL's...

-Stu
Afrow UK is offline   Reply With Quote
Old 19th December 2004, 16:42   #53
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Plug-in takes all parameters from the stack only. And I thought this is mainroad of NSIS plug-in usage (or I misunderstood something?). Installer pushes command line parameters to stack before plug-in call, plug-in uses popstring() for [IN] parameters and pushstring() for [OUT] result (because all plug-in entry points are 'void' type). I guess
Takhir is offline   Reply With Quote
Old 19th December 2004, 17:26   #54
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Oh I see now. I didn't know that sorry

It now works bloody perfect, excellent! I can now distribute my installer (wahoo!)

-Stu
Afrow UK is offline   Reply With Quote
Old 5th January 2005, 18:38   #55
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Last version archive page http://nsis.sourceforge.net/archive/...instances=0,32
Takhir is offline   Reply With Quote
Old 11th January 2005, 06:55   #56
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
I tested new version, it supports MSI banner mode, two parameters set this window caption and text "/BANNER CAPTION TEXT". Multilined text may be created using $\n character in the TEXT string, up to 3 lines I could add there. Plug-in displays package first icon in the top left corner of the banner window. Progress bar appears when (and if) file size comes from server, so if file size is unavailable (chunked reply, very seldom for static files) or file size is < 8 kB and line is fast, progress bar may stay hidden.
Attached Files
File Type: zip inetload.zip (19.6 KB, 822 views)
Takhir is offline   Reply With Quote
Old 18th February 2005, 20:16   #57
mrtech
Junior Member
 
Join Date: Oct 2002
Posts: 46
I've just notice a little issue with the status returned after downloading. I've seen this on Win2k & XPsp1 systems so far, what happens is that InetLoad return "1" instead of "Ok" after succesfully downloading a file. Here's my code snippet that I'm using with 2.05:
code:
InetLoad::load "${PRODUCT_URL}$WEBFILE" "$TEMP\$WEBFILE"

MessageBox MB_YESNO|MB_ICONQUESTION "$0" 0 0
StrCmp $0 "Ok" 0 dlskip

ExecWait '"$TEMP\$WEBFILE" /q'

Delete '"$TEMP\$WEBFILE"'
dlskip:



Had to change "Ok" to "1" to get it to work again. Using the archive 1/18/2005 build.
mrtech is offline   Reply With Quote
Old 18th February 2005, 21:56   #58
robber98
Junior Member
 
Join Date: May 2004
Posts: 29
Quote:
Originally posted by mrtech
I've just notice a little issue with the status returned after downloading. I've seen this on Win2k & XPsp1 systems so far, what happens is that InetLoad return "1" instead of "Ok" after succesfully downloading a file. Here's my code snippet that I'm using with 2.05:
code:
InetLoad::load "${PRODUCT_URL}$WEBFILE" "$TEMP\$WEBFILE"

MessageBox MB_YESNO|MB_ICONQUESTION "$0" 0 0
StrCmp $0 "Ok" 0 dlskip

ExecWait '"$TEMP\$WEBFILE" /q'

Delete '"$TEMP\$WEBFILE"'
dlskip:



Had to change "Ok" to "1" to get it to work again. Using the archive 1/18/2005 build.
Don't you have to pop the return value after InetLoad? I don't see it from your code.
robber98 is offline   Reply With Quote
Old 18th February 2005, 23:24   #59
mrtech
Junior Member
 
Join Date: Oct 2002
Posts: 46
oops, thanks.
mrtech is offline   Reply With Quote
Old 21st February 2005, 11:48   #60
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
2 updates: Resume option (for really bad connections ) and ftp "file not found" check out. If resume option set (/RESUME "Do u want to retry?") and error occure (except "not found"), plug-in first asks user to check connection. Many thanks to Afrow UK and azmoviez for ideas and help.
Attached Files
File Type: zip inetload.zip (20.6 KB, 777 views)
Takhir is offline   Reply With Quote
Old 2nd March 2005, 14:17   #61
Yurik
Senior Member
 
Join Date: Oct 2004
Posts: 103
Takhir,
is it possible to set proxy settings (proxy/port/user/password) for your plugin inside the NSIS script?
Thanks

Computer Forensics Investigations, Internet Security and Parental Control, - http://belkasoft.com
Yurik is offline   Reply With Quote
Old 3rd March 2005, 11:36   #62
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
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.
Attached Files
File Type: zip inetload.zip (21.1 KB, 1366 views)
Takhir is offline   Reply With Quote
Old 9th March 2005, 08:44   #63
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
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").
Attached Files
File Type: zip inetload.zip (21.2 KB, 762 views)
Takhir is offline   Reply With Quote
Old 25th March 2005, 11:00   #64
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 25th March 2005, 12:49   #65
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
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..
Attached Files
File Type: zip inetload.zip (8.0 KB, 708 views)
Takhir is offline   Reply With Quote
Old 25th March 2005, 14:16   #66
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 26th March 2005, 00:30   #67
dujuan
Junior Member
 
Join Date: Aug 2004
Posts: 25
Great plugin!
Does this plugin support timeout parameter like nsisdl ?
dujuan is offline   Reply With Quote
Old 26th March 2005, 12:47   #68
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
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.
Attached Files
File Type: zip inetload.zip (21.6 KB, 850 views)
Takhir is offline   Reply With Quote
Old 28th March 2005, 15:01   #69
delboy
Junior Member
 
Join Date: Jun 2004
Location: London
Posts: 15
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)?
delboy is offline   Reply With Quote
Old 28th March 2005, 16:28   #70
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
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
Takhir is offline   Reply With Quote
Old 1st April 2005, 14:04   #71
delboy
Junior Member
 
Join Date: Jun 2004
Location: London
Posts: 15
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.
delboy is offline   Reply With Quote
Old 14th April 2005, 04:03   #72
seniorquico
Junior Member
 
Join Date: Apr 2005
Location: San Luis Obispo, CA
Posts: 1
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):
code:
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.
seniorquico is offline   Reply With Quote
Old 14th April 2005, 06:29   #73
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
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:
code:

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 loginassword in the LAN, and not found any problems. And I hope that bad syntax only might cause crash
Takhir is offline   Reply With Quote
Old 15th April 2005, 09:55   #74
dujuan
Junior Member
 
Join Date: Aug 2004
Posts: 25
Does this plug support rtsp or mms protocol ?
dujuan is offline   Reply With Quote
Old 15th April 2005, 10:23   #75
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
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 is offline   Reply With Quote
Old 18th April 2005, 08:10   #76
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
CrackUrl() string buffers length bug fixed (256->NSIS string_size).
Attached Files
File Type: zip inetload.zip (21.7 KB, 839 views)
Takhir is offline   Reply With Quote
Old 23rd April 2005, 12:01   #77
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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 is offline   Reply With Quote
Old 23rd April 2005, 19:18   #78
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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 is offline   Reply With Quote
Old 23rd April 2005, 21:18   #79
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 25th April 2005, 20:43   #80
Jnuw
Senior Member
 
Join Date: Sep 2004
Location: Wisconsin, US
Posts: 258
Quote:
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
Jnuw is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump