Archive: question about nsisdl::download


question about nsisdl::download
I used nsisdl::download (see below) in my script.

nsisdl::download /TRANSLATE "$(DESC_DOWNLOADING)" "$(DESC_CONNECTING)" \
"$(DESC_SECOND)" "$(DESC_MINUTE)" "$(DESC_HOUR)" "$(DESC_PLURAL)" \
"$(DESC_PROGRESS)" "$(DESC_REMAINING)" \
/TIMEOUT=30000 "${URL_DOTNET_1033}" "$PLUGINSDIR\dotnetfx.exe"

But there is nothing on screen. I'm wondering why.
I need a window to show progress info.


I appreciate your help very much.


try it without defines and supply a valid url

you may be surprised that there is a status window :)


I tried
nsisdl::download "${URL_DOTNET_1033}" "$PLUGINSDIR\dotnetfx.exe"

Nothing appeared.


You should be using curly brackets for the defines! { not (

-Stu


Hi Stu,
Thanks for your info.
I changed, but still nothing.

nsisdl::download /TRANSLATE "${DESC_DOWNLOADING}" "${DESC_CONNECTING}" \
"${DESC_SECOND}" "${DESC_MINUTE}" "${DESC_HOUR}" "${DESC_PLURAL}" \
"${DESC_PROGRESS}" "${DESC_REMAINING}" \
/TIMEOUT=30000 "${URL_DOTNET_1033}" "$PLUGINSDIR\dotnetfx.exe"


Please attach your script.

-Stu


Thank you very much, Stu for your help.
When I put the nsisdl::download /TRANSLATE into .onInit,
there is no progress bar. When I put it into Section -AdditionalIcons, the progrss bar came out. Is it normal?


Ah well you never mentioned that :p

Although it doesn't say in the readme, NSISdl's dialogue will only be shown if you call NSISdl from a Section. This is because NSISdl duplicates the progess bar (msctls_progress32) and label (static) controls from the InstFiles page for its progress bar and message (% done).

All I can suggest is that if you are going to use it outside the InstFiles page, you show a Banner displaying a message.

-Stu


Long-long ago I wrote http client for my program (Win95 compatibility). And I remember 3 situations with file length:

1. CONTENT-LENGTH: presents in http header. Found in NSISdl code - it generates error if not finds this (optional) header
'error = "Server did not specify content length.";'
May be this is warning only ..

2. length not defined at all, so program can try to read it till end. May be this also works in NSISdl.

3. (my question) TRANSFER-ENCODING: chunked . VC editor could not find "chunk" in NSISdl sources. It looks like plug-in not checks this http header. At least program must remove chunk headers (== chunk length) in the data stream, otherwise content will be corrupted. I could not find this is in code, so can anybody say me that chunked replys work with NSISdl?


Originally posted by routing
When I put the nsisdl::download /TRANSLATE into .onInit,
there is no progress bar. When I put it into Section -AdditionalIcons, the progrss bar came out. Is it normal?
Sometimes this helps :)

System::Call "comctl32::InitCommonControls()"

Sometimes this helps :)

System::Call "comctl32::InitCommonControls()"
Function .onInit doesn't have the GUI initialized yet, so it won't work.

Originally posted by deguix
Function .onInit doesn't have the GUI initialized yet, so it won't work.
This is initialization of common controls itself :) (i.e. progress bar init). Installer calls this or ...Ex() function later, on it's own GUI init - without this WIN32 apps cannot create list and tree views, progress and status bars, tabs and others. /NOUNLOAD key may also require in this plugin call.

InitCommonControls is called before .onInit is called. But as deguix said, the NSIS dialog is not yet created when .onInit is called. NSISdl uses the NSIS dialog as its parent.

TRANSFER-ENCODING: chunked is a feature of HTTP/1.1. NSISdl uses HTTP/1.0.