- NSIS Discussion
- question about nsisdl::download
Archive: question about nsisdl::download
routing
1st November 2004 16:53 UTC
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.
razor_x
1st November 2004 17:03 UTC
try it without defines and supply a valid url
you may be surprised that there is a status window :)
routing
1st November 2004 17:37 UTC
I tried
nsisdl::download "${URL_DOTNET_1033}" "$PLUGINSDIR\dotnetfx.exe"
Nothing appeared.
Afrow UK
1st November 2004 17:39 UTC
You should be using curly brackets for the defines! { not (
-Stu
routing
1st November 2004 17:43 UTC
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"
Afrow UK
1st November 2004 18:59 UTC
Please attach your script.
-Stu
routing
1st November 2004 19:34 UTC
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?
Afrow UK
1st November 2004 21:47 UTC
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
Takhir
3rd November 2004 11:52 UTC
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?
Takhir
3rd November 2004 15:50 UTC
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()"
deguix
3rd November 2004 20:14 UTC
Sometimes this helps :)
System::Call "comctl32::InitCommonControls()"
Function .onInit doesn't have the GUI initialized yet, so it won't work.
Takhir
4th November 2004 06:38 UTC
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.
kichik
4th November 2004 18:22 UTC
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.