Could not reproduce with 2.02 - works fine, but this happens with 2.03 (on my home Win98SE) 🙁 And $HWNDPARENT is NULL, we cannot use SetForegroundWindow() syscall to improve your situation. May be NSIS devs can say something? Plug-in always creates it's dialog window (required for download sync), it is hidden in silent mode and has NULL parent, but I don't know how this can cause later abnormal bihavior of 2.03.
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?
http + ftp download plug-in
545 posts
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.
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.
Attached version recognizes silent installer mode even without /SILENT flag in the plug-in's call.
extra->exec_flags->silent != 0 is the most reliable way to detect silent installers. That is what NSIS itself uses.
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
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
I'll think about command line switch to support both modes 😉
Originally posted by TakhirThat would be a very good idea. I'm also using NSISdl, so if you could implement NSISdl's dialogue features into yours (including the text string settings) then that would be awsome.
I'll think about command line switch to support both modes 😉
-Stu
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.
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).
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).
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
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
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.
1006 redraw (RedrawWindow(with erase background))
Downloading ...
Connecting now appears at the beginning of download.
The problem is still there with the overlapping text.
Compile this example; it shows the problem.
-Stu
Compile this example; it shows the problem.
-Stu
Updated. Tested on Win98 SE and WinXP Pro.
And I still hope that InetLoad sounds better then NSISdl 😉
And I still hope that InetLoad sounds better then NSISdl 😉
Works beautifully, well done!
I will convert my installer over to InetLoad 🙂
-Stu
I will convert my installer over to InetLoad 🙂
-Stu
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
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
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
-Stu
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
"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
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'.
And one more redraw of 1006 control on exit added, sorry, it's for 'Completed'.
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
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
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 😉
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 😉
Ah very cool! 🙂
I will try it out in a few minutes (when my map finishes compiling).
-Stu
I will try it out in a few minutes (when my map finishes compiling).
-Stu
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
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
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 🙂
Oh I see now. I didn't know that sorry 😁
It now works bloody perfect, excellent! I can now distribute my installer (wahoo!)
-Stu 😁
It now works bloody perfect, excellent! I can now distribute my installer (wahoo!)
-Stu 😁
Last version archive page http://nsis.sourceforge.net/archive/...instances=0,32
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.
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:
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.Originally posted by mrtechDon't you have to pop the return value after InetLoad? I don't see it from your code.
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:
Had to change "Ok" to "1" to get it to work again. Using the archive 1/18/2005 build.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:
oops, thanks.
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.