![]() |
#1 |
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
http + ftp download plug-in
Attached plugin supports http and ftp downloads. Included script sample downloads 2 mp3 files (one for each protocol). I wrote it fast (from code pieces I had
![]() ![]() But finally http works good (many thanks to MS guys), I even tested download restart after disconnect (but this require more tests). Re-get defaults: disabled, pause 5 sec. |
![]() |
![]() |
![]() |
#2 |
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
wording improved
![]() |
![]() |
![]() |
![]() |
#3 |
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
Empty file size fields looks lonely
![]() |
![]() |
![]() |
![]() |
#4 |
Guest
Posts: n/a
|
Can this plugin download silent and with process?
can can shellexecute it. I am new in NSIS can you include a simple example? Thanks... |
![]() |
![]() |
#5 |
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
This may be interesting - start download at the very beginning and run 2 processes, installation itself and file download (or I misunderstood something?).
It is possible to run dll as a process using rundll(32).dll, only new plug-in dll entry point required for this (short function). Programming side of problem is simple, but I'd like to understand first how to make working ftp reget using FtpCommand() call (size and restart commands). After this - may be. If you want hide plug-in dialog in it's current state - comment ShowWindow() line in source code and rebuild project. |
![]() |
![]() |
![]() |
#6 |
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
What are the minimum requirements for this plug-in? It takes proxy settings from IE, right? I have been meaning to write a new NSISdl based on IE's downloading engine to solve all of those proxy problems. If you're already at it, how about you add an option to download more than one file in a row, I review the code, and we slap a NSISdl2 tag on it?
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
![]() |
![]() |
![]() |
#7 |
Senior Member
Join Date: Sep 2004
Location: Los Angeles
Posts: 223
|
yea
![]() I am having a lot of problems with corporate networks using proxy settings a new NSISdl would be fantastic g |
![]() |
![]() |
![]() |
#8 | |
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
Quote:
![]() ![]() Minimum requirements... HTTP without problems. I also thought about re-get functionality (for installers trying to download dotnetfx via dial-up) and about ftp, but it looks like both idias are not claimed by developers ![]() OK, simple and stable http download without re-get, but more then one file. I thought about local path definition only (instead of every local file parameter), but this limits functionality with static server files only (not cgi/php), so parameters line is following: InetLoad::load URL1 local_file1 [URL2 local_file2 [...]] ftp works, but it not requests file size - InternetOpenUrl() functionality is limited. |
|
![]() |
![]() |
![]() |
#9 |
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
to Kichik
I also thought a little about extended requirements and result attached, better ftp and simple (hidden) re-get. But more code - more bugs ![]() |
![]() |
![]() |
![]() |
#10 |
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
I fixed one bug in last (extended) version and improved download status displaying.
|
![]() |
![]() |
![]() |
#11 |
Senior Member
Join Date: Sep 2004
Location: Los Angeles
Posts: 223
|
is inetload working with proxy networks...or is that a future thing ?
g |
![]() |
![]() |
![]() |
#12 |
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
Good question. Plug-in works in my proxy tests, but this is 10% of success only
![]() ![]() Thanks. Attached version functionality is almost the same as in the previous post, I only made an attempt to remember "coding rules" and re-formatted source text (for possible cvs commits ![]() |
![]() |
![]() |
![]() |
#13 |
Senior Member
Join Date: Sep 2004
Location: Los Angeles
Posts: 223
|
will do and report back...
![]() g |
![]() |
![]() |
![]() |
#14 |
Senior Member
Join Date: Sep 2004
Location: Los Angeles
Posts: 223
|
could add a Silent feature ?
something like: inetLoad::load /SILENT "http://blah.com/blah.jpg" "$EXEDIR\blah.jpg" will possibly get this thing tested today ![]() g |
![]() |
![]() |
![]() |
#15 |
Senior Member
Join Date: Sep 2004
Location: Los Angeles
Posts: 223
|
great news
![]() initial tests from a client came back successful... I'll go there myself to make sure later in the week... but this is very good news as nothing was getting thru with nsisdl g |
![]() |
![]() |
![]() |
#16 |
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
Many thanks, grahama. I'll add this option (I tested right now - plug-in can take string from the stack and push it back if this is not /silent parameter
![]() |
![]() |
![]() |
![]() |
#17 |
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
New plug-in version with /SILENT support (optional).
Usage: InetLoad::load [/SILENT] URL1 local_file1 [URL2 local_file2 [...]] Returns "OK" string if download successful Pop $0 StrCmp $0 "OK" dlok MessageBox ... Quit dlok: ... |
![]() |
![]() |
![]() |
#18 |
Senior Member
Join Date: Sep 2004
Location: Los Angeles
Posts: 223
|
thanks for the Silent Feature Takhir
is there a way I could pass along download info to the MUI interface like Nsisdl does ? very cool stuff ![]() g |
![]() |
![]() |
![]() |
#19 |
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
NSISdl uses "files" page for progress bar and status display. My variant uses it's own dialog window and may work even from .onInit function (without installer page) - I know situations when this is important. And I guess it is better to use more space for all these numbers and names displaying - url, local file, file size, done, transfer rate, remaining time, total time, percents. Another words I'd like to keep my dialog
![]() I see 2 situations: 1) installer is visible and plug-in window appears as it is; 2) totally silent install and plug-in is also hidden (some logic may require in the plug-in call). But it may be good to add something meaning above general prograss bar (1006 static, where installer shows file names) ![]() |
![]() |
![]() |
![]() |
#20 |
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
In the latest CVS version, NSIS passes the silent flag which you can check.
I prefer the download dialog to show inside the NSIS dialog. It looks nicer. NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
![]() |
![]() |
![]() |
#21 |
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
Situation: program requires system SP to be installed ( >100 MB), this was found in .onInit function, but where to download SP? File copy page IMHO is not good place for this, might be better to do this after License page or even in .onInit function. But where to show progress bar if Installer’ dialog window not exists yet or have some other controls in this place (middle of the box). Or developers must create custom page for plug-in? I still guess that dialog box is better way (while dialog design is ugly ). Also: when user closes plug-in dialog window, plug-in’s main (dialog) thread tries to stop or terminate i/o thread – not bad when i/o hangs. When embedded to installer page this is not so obvious.
I added extra->exec_flags->silent support in some #ifdef’s to keep compatibility with current NSIS version (<=2.02). Code attached. |
![]() |
![]() |
![]() |
#22 |
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
No files should be downloaded in .onInit and anywhere else but the instfiles page. In my opnion, that's an annoying installer. I prefer installers to start "installing" only once I click install and verify all the parameters. But that can an option.
In NSISdl, another progress bar is created for the download status. Clicking the Cancel button is more obvious than closing the download window. NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
![]() |
![]() |
![]() |
#23 |
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
I saw new progress bar created by NSISdl, but this is OK on instfiles page only, where this place is free. On the instfiles page - yes, this works fine.
When plug-in window is visible, installer page (if any) is unavailable, and (I hope) user will find how to close plug-in window. Or I can add there Cancel button (very easy in VS GUI). The only place to start installation - yes, this is the best way, but life is very strange thing ![]() |
![]() |
![]() |
![]() |
#24 |
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
The dialog area is free when a plug-in is called inside a custom page callback function.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
![]() |
![]() |
![]() |
#25 |
Senior Member
Join Date: Sep 2004
Location: Los Angeles
Posts: 223
|
for myself, I use banners in the beginning to alert the user of a version check....I download an ini file and compare it to the values in the registry...because the inetLoad plugin is larger the banner...it looks a little strange...This is only cosmetic, but I thought it was worth bringing up
![]() having all the strings passed to the MUI [instead of the plugin dialog window] would be helpful in this particular situation... |
![]() |
![]() |
![]() |
#26 |
Senior Member
Join Date: Sep 2004
Location: Los Angeles
Posts: 223
|
Ok, I went over to Univision's [the client] corporate office and inetload did not work with their proxy network
![]() I am kind of at my wits end with this...Is there another installer product that works with proxy or is this something in the queue for NSIS...here is something odd that might be of note. My Apple powerbook[OS X] using Virtual PC [Win2k] gets thru their network on DHCP. Using the same installer app on THEIR pc does not get thru..... What would this point to ? many thanks as I considering hard drugs at this point ![]() g |
![]() |
![]() |
![]() |
#27 |
Senior Member
Join Date: Sep 2004
Location: Wisconsin, US
Posts: 258
|
I'm having a problem too with my work's proxy. When i try to use inetload to download a text file, the text file's contents are overwritten with the page can not be display message, and the following:
HTTP 407 Proxy Authentication Required - The ISA Server requires authorization to fulfill the request. Access to the Web Proxy service is denied. (12209) Internet Security and Acceleration Server Any ideas? Thanks all. |
![]() |
![]() |
![]() |
#28 |
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
It’s not easy to debug program if you cannot touch the problem with your own hands J
I made one minor improvement for error 407 (proxy authorization), might be good to test it. But the main question is in explicit proxy authorization if IE registry parameters (already used) are not enough for connection. This require user_name and password. I see 2 simple ways to resolve the problem, silent InternetSetOption(INTERNET_OPTION_PROXY_PASSWORD + INTERNET_OPTION_PROXY_USERNAME) if these parameters presents in the plug-in call (something like “load /PASSWD=passwd …”) or popup dialog (InternetErrorDlg for example), where user can enter name and passwd for proxy auth (not works in the silent mode). Both variants may present in program, of course. First is good for corporate network distribution, second – for Inet downloads. If this is what you need – I’ll be in office in Monday and can make changes next week. Also few words about http server authorization (error 401) – it is possible to define name and password in the URL, program extracts both parameters (if any. I did this for FTP if anonymous user is not accepted). |
![]() |
![]() |
![]() |
#29 |
Senior Member
Join Date: Sep 2004
Location: Wisconsin, US
Posts: 258
|
SUCCESS!! Your new inetload cut right through my company's proxy! Thank you so much Takhir.
|
![]() |
![]() |
![]() |
#30 |
Senior Member
Join Date: Sep 2004
Location: Wisconsin, US
Posts: 258
|
Takhir, I found a minor issue. Your plugin is still working beautifully, and getting through my proxy with out any problems, so thanks again.
I'm using your plugin with nsis 2.03, no MUI, and with a silent install. I'm just using message boxes and banners. If I run the InetLoad::load command with the /SILENT switch, all future message boxes appear in the background behind other windows. If I remove the /SILENT switch from the InetLoad::load, which is fine, message boxes appear in front as they should. I tried using the BringToFront command, but that did not work. Just wanted to let you know about this, but all in all, your plugin is working great! |
![]() |
![]() |
![]() |
#31 |
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
Could not reproduce with 2.02 - works fine, but this happens with 2.03 (on my home Win98SE)
![]() BTW - question to NSIS developers - while I see $HWNDPARENT == 0 in the 'SilentInstall silent' mode, can I use it instead of new 'extra->exec_flags->silent > 0' flag ? Is this a reliable way? |
![]() |
![]() |
![]() |
#32 |
Senior Member
Join Date: Sep 2004
Location: Wisconsin, US
Posts: 258
|
No problem Takhir, thanks for looking into the minor problem. I don't mind running your plugin in non-silent mode, which corrects the problem. I'm still very pleased that your plugin gets through my proxy, so thanks again.
|
![]() |
![]() |
![]() |
#33 |
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
You can simply download and install 2.02 version - InetLoad worked fine with it silent mode. Problems appears in 2.03 only (and this not the first situation with 2.03).
Attached version recognizes silent installer mode even without /SILENT flag in the plug-in's call. |
![]() |
![]() |
![]() |
#34 |
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
extra->exec_flags->silent != 0 is the most reliable way to detect silent installers. That is what NSIS itself uses.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
![]() |
![]() |
![]() |
#35 |
Senior Member
Join Date: Sep 2004
Location: Los Angeles
Posts: 223
|
great
![]() I am no longer having proxy problems either...Just tried it again today at their corp headquaters. Is there any possibility that this plugin could be integrated into the the MUI ? In my case, it would look a bit slicker....as I was using nsisdl... great job, Takhir ![]() g |
![]() |
![]() |
![]() |
#36 |
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
I'll think about command line switch to support both modes
![]() |
![]() |
![]() |
![]() |
#37 | |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Quote:
-Stu |
|
![]() |
![]() |
![]() |
#38 |
Junior Member
Join Date: Oct 2002
Posts: 46
|
I just started using this little dittie, but had to put the whole dialog into silent mode. With the ns dl'er the full path was that was downloading was not shown, I preferred that. Is there a switch you can add for /hideurlprefix or /showfilenameonly or something like that, thanks.
|
![]() |
![]() |
![]() |
#39 |
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
First draft, but I could load some files with it
![]() Requires 2.03 – new plug-in parameter in this version is the only way to auto-recognize silent install without explicit /SILENT parameter on any step including .onInit (where main installer window not exists yet). /TIMEOUT parameter not implemented because MSDN describes many timeout flags (connect, receive, control send and receive, data send and receive…), so I guess would be better to left defaults. /POPUP key displays detailed download dialog instead of embedded progress bar. Very useful in .onInit function (i.e. not in Section). So default is old (NSISdl) GUI ![]() /SILENT key explicitly prevents from displaying of any plug-in' output (both popup dialog and embedded progress bar). Not required if 'SilentInstall silent' mode is defined in installation script. Now plug-in displays short file name (like NSISdl did) And I still hope that NSIS developers can solve 2.03 problem with new windows going to background in the silent mode (this worked fine in 2.02). |
![]() |
![]() |
![]() |
#40 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
I tried the plugin with the NSISdl interface. I found one problem...
My title control (1006) has a transparent background (because you can't not have a transparent background when setting text colour using SetCtlColors for some reason). When I use InetLoad I get two layers of text on it: InetLoad plug-in and [download name]. Edit: Could you also change it to "Downloading [download name]..." To fix the problem you need to refresh the label control by hiding it and showing it again and then set its text. -Stu |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|