| 1 |
NSISdl 1.3 - HTTP downloading plugin for NSIS |
| 2 |
--------------------------------------------- |
| 3 |
|
| 4 |
Copyright (C) 2001-2002 Yaroslav Faybishenko & Justin Frankel |
| 5 |
|
| 6 |
This plugin can be used from NSIS to download files via HTTP. |
| 7 |
Note: HTTPS is not supported, only plain HTTP! |
| 8 |
|
| 9 |
To connect to the internet, use the Dialer plugin. |
| 10 |
|
| 11 |
USAGE |
| 12 |
----- |
| 13 |
|
| 14 |
NSISdl::download http://www.domain.com/file localfile.exe |
| 15 |
|
| 16 |
You can also pass /TIMEOUT to set the timeout in milliseconds: |
| 17 |
|
| 18 |
NSISdl::download /TIMEOUT=30000 http://www.domain.com/file localfile.exe |
| 19 |
|
| 20 |
The return value is pushed to the stack: |
| 21 |
|
| 22 |
"cancel" if cancelled |
| 23 |
"success" if success |
| 24 |
otherwise, an error string describing the error |
| 25 |
|
| 26 |
If you don't want the progress window to appear, use NSISdl::download_quiet. |
| 27 |
|
| 28 |
Example of usage: |
| 29 |
|
| 30 |
NSISdl::download http://www.domain.com/file localfile.exe |
| 31 |
Pop $R0 ;Get the return value |
| 32 |
StrCmp $R0 "success" +3 |
| 33 |
MessageBox MB_OK "Download failed: $R0" |
| 34 |
Quit |
| 35 |
|
| 36 |
For another example, see waplugin.nsi in the examples directory. |
| 37 |
|
| 38 |
PROXIES |
| 39 |
------- |
| 40 |
|
| 41 |
NSISdl supports only basic configurations of proxies. It doesn't support |
| 42 |
proxies which require authentication, automatic configuration script, etc. |
| 43 |
NSISdl reads the proxy configuration from Internet Explorer's registry key |
| 44 |
under HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings. It |
| 45 |
reads and parses ProxyEnable and ProxyServer. |
| 46 |
|
| 47 |
If you don't want NSISdl to use Internet Explorer's settings, use the |
| 48 |
/NOIEPROXY flag. /NOIEPROXY should be used after /TRANSLATE and |
| 49 |
/TIMEOUT. For example: |
| 50 |
|
| 51 |
If you want to specify a proxy on your own, use the /PROXY flag. |
| 52 |
|
| 53 |
NSISdl::download /NOIEPROXY http://www.domain.com/file localfile.exe |
| 54 |
NSISdl::download /TIMEOUT=30000 /NOIEPROXY http://www.domain.com/file localfile.exe |
| 55 |
NSISdl::download /PROXY proxy.whatever.com http://www.domain.com/file localfile.exe |
| 56 |
NSISdl::download /PROXY proxy.whatever.com:8080 http://www.domain.com/file localfile.exe |
| 57 |
|
| 58 |
TRANSLATE |
| 59 |
--------- |
| 60 |
|
| 61 |
To translate NSISdl add the following values to the call line: |
| 62 |
|
| 63 |
/TRANSLATE2 downloading connecting second minute hour seconds minutes hours progress |
| 64 |
|
| 65 |
Default values are: |
| 66 |
|
| 67 |
downloading - "Downloading %s" |
| 68 |
connecting - "Connecting ..." |
| 69 |
second - " (1 second remaining)" |
| 70 |
minute - " (1 minute remaining)" |
| 71 |
hour - " (1 hour remaining)" |
| 72 |
seconds - " (%u seconds remaining)" |
| 73 |
minutes - " (%u minutes remaining)" |
| 74 |
hours - " (%u hours remaining)" |
| 75 |
progress - "%skB (%d%%) of %skB @ %u.%01ukB/s" |
| 76 |
|
| 77 |
The old /TRANSLATE method still works for backward compatibility. |
| 78 |
|
| 79 |
/TRANSLATE downloading connecting second minute hour plural progress remaining |
| 80 |
|
| 81 |
Default values are: |
| 82 |
|
| 83 |
downloading - "Downloading %s" |
| 84 |
connecting - "Connecting ..." |
| 85 |
second - "second" |
| 86 |
minute - "minute" |
| 87 |
hour - "hour" |
| 88 |
plural - "s" |
| 89 |
progress - "%dkB (%d%%) of %ukB @ %d.%01dkB/s" |
| 90 |
remaining - " (%d %s%s remaining)" |
| 91 |
|
| 92 |
/TRANSLATE and /TRANSLATE2 must come before /TIMEOUT. |