InetLoad plug-in: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Updated author and download links, and changed format of some pages.)
(→‎Description: Making it clear that Inetc has replaced this)
 
(16 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{PageAuthor|Takhir}}
== Links ==
== Links ==
[http://forums.winamp.com/showthread.php?s=&threadid=198596&perpage=40&highlight=InetLoad&pagenumber=2 Download Page]
 
Download:<br>
<attach>InetLoad.zip</attach>
 
[http://forums.winamp.com/showthread.php?threadid=198596 Forum thread]


== Description ==
== Description ==
'''Deprecated by:''' [[Inetc plug-in]].
{| style="background-color: #FFF; color:#000; width:100%; color:#353638;"
{{Pp-deprecated}}
|}
MS WinInet API based plug-in for http and ftp downloads with better proxy support (compare to NSISdl plug-in). Command line may include few URL/File pairs to be downloaded. Plug-in supports 3 "download in progress" display modes:
MS WinInet API based plug-in for http and ftp downloads with better proxy support (compare to NSISdl plug-in). Command line may include few URL/File pairs to be downloaded. Plug-in supports 3 "download in progress" display modes:
# old NSISdl style - additional embedded progress bar and text on the INSTFILES page; # POPUP dialog mode with detailed info; # BANNER mode with simple popup window.
 
Plug-in recognizes Installer's Silent mode and this case hides any output. Program implements simple re-get functionality - host reconnect and download from current position after short pause. NSISdl code fragment was used for progress bar displaying in the "old style" mode.
# old NSISdl style - additional embedded progress bar and text on the INSTFILES page;
Requires NSIS 2.03 or later.
# POPUP dialog mode with detailed info;
# BANNER mode with simple popup window.
 
Plug-in recognizes Installer's Silent mode and this case hides any output (this feature requires NSIS 2.03 or later). Program implements simple re-get functionality - host reconnect and download from current position after short pause. While program depends on IE settings, it changes current IE mode to online. NSISdl code fragment was used for progress bar displaying in the "old style" mode.
 
== Command line parameters (NSIS script) ==
== Command line parameters (NSIS script) ==
  InetLoad::load [/PROXY IP:PORT] [/USERNAME LOGIN /PASSWORD PASSWD]
 
  [/TIMEOUT INT_MS] [/SILENT] [/RESUME RETRY_QUESTION]
  InetLoad::load [/PROXY IP:PORT] [/USERNAME PROXY_LOGIN /PASSWORD PROXY_PASSWD]
[/POPUP PREFIX | /BANNER CAPTION TEXT] [/TRANSLATE LANG_PARAMS]
  [/NOPROXY] [/NOCANCEL] [/POST TEXT2POST] [/TIMEOUT INT_MS] [/SILENT TEXT2DISPLAY]
[/RESUME RETRY_QUESTION] [/POPUP PREFIX | /BANNER CAPTION TEXT] [/TRANSLATE LANG_PARAMS]
  URL1 local_file1 [URL2 local_file2 [...]] [/END]
  URL1 local_file1 [URL2 local_file2 [...]] [/END]


Line 21: Line 38:
; /PASSWORD
; /PASSWORD
: Proxy password (http only).  For server (http/ftp) authentication it is possible to use URL encoded name and password, for example <nowiki>http://username:password@nsis.sourceforge.net</nowiki>.
: Proxy password (http only).  For server (http/ftp) authentication it is possible to use URL encoded name and password, for example <nowiki>http://username:password@nsis.sourceforge.net</nowiki>.
;/NOPROXY
: Disables proxy settings for this connection (if any)
;/NOCANCEL
: Prevents download from being interrupted by user (locks Esc, Alt-F4, Cancel handling)
; /POST
: Sets POST http mode and defines text string to be used in the POST (http only). Disables auto re-get. No char replaces used (%20 and others).


; /TIMEOUT
; /TIMEOUT
Line 26: Line 52:


; /SILENT
; /SILENT
: Key hides plug-in' output (both popup dialog and embedded progress bar). Not required if 'SilentInstall silent' mode was defined in script (NSIS 2.03 option).
: Key hides plug-in' output (both popup dialog and embedded progress bar). Sets TEXT2DISPLAY to 1006 control, if /silent "" - displays "InetLoad plug-in" default. Not required if 'SilentInstall silent' mode was defined in script (NSIS 2.03 option).


; /RESUME
; /RESUME
Line 32: Line 58:


; /POPUP
; /POPUP
: Mode displays detailed download dialog instead of embedded progress bar. Very useful in .onInit function (i.e. not in Section).
: This mode displays detailed download dialog instead of embedded progress bar. PREFIX parameter sets left part of dialog caption (before '-'), default is "InetLoad plug-in" (if ""). Also useful in .onInit function (i.e. not in Section).


; /BANNER  
; /BANNER  
Line 40: Line 66:
: Allows to limit plug-in stack reading (optional, required if you stores other vars in the stack).
: Allows to limit plug-in stack reading (optional, required if you stores other vars in the stack).


; /TRANSLATE : Allows to translate plug-in text in the "old style" mode (see Readme for parameters). == Examples ==
; /TRANSLATE
: Allows translating plug-in text in the POPUP or "old style" (NSISdl) modes (see Readme for parameters). In the BANNER mode text is also customizable.
 
== Examples ==
 
<highlight-nsis>
<highlight-nsis>
InetLoad::load "http://dl.zvuki.ru/6306/mp3/12.mp3" "$EXEDIR\12.mp3" \
InetLoad::load "http://dl.zvuki.ru/6306/mp3/12.mp3" "$EXEDIR\12.mp3" \
Line 48: Line 78:


<highlight-nsis>
<highlight-nsis>
InetLoad::load /BANNER "" "Cameron Diaz download in progress..." \ "http://www.dreamgirlswallpaper.co.uk/fiveyearsonline/wallpaper/Cameron_Diaz/camerond09big.JPG" \ "$EXEDIR\cd.jpg"   Pop $0   StrCmp $0 "OK" dlok   MessageBox MB_OK|MB_ICONEXCLAMATION "Download Error, click OK to abort installation" /SD IDOK
InetLoad::load /BANNER "" "Cameron Diaz download in progress..." \
   Abort dlok:
"http://www.dreamgirlswallpaper.co.uk/fiveyearsonline/wallpaper/Cameron_Diaz/camerond09big.JPG" \
"$EXEDIR\cd.jpg"
   Pop $0
   StrCmp $0 "OK" dlok
   MessageBox MB_OK|MB_ICONEXCLAMATION "Download Error, click OK to abort installation" /SD IDOK
   Abort
dlok:
   ...
   ...
</highlight-nsis>
</highlight-nsis>
Line 55: Line 91:
Plug-in returns "OK" string if successful, error description string if failed (see included InetLoad.cpp file for a full set of status strings). Usage and result processing samples are included to the package.
Plug-in returns "OK" string if successful, error description string if failed (see included InetLoad.cpp file for a full set of status strings). Usage and result processing samples are included to the package.


Page author: [[User:Takhir|Takhir]]
[[Category:Plugins]]

Latest revision as of 04:12, 18 June 2010

Author: Takhir (talk, contrib)


Links

Download:
InetLoad.zip (33 KB)

Forum thread

Description

Deprecated by: Inetc plug-in.

This project or code is deprecated and is here for archival purposes only.

MS WinInet API based plug-in for http and ftp downloads with better proxy support (compare to NSISdl plug-in). Command line may include few URL/File pairs to be downloaded. Plug-in supports 3 "download in progress" display modes:

  1. old NSISdl style - additional embedded progress bar and text on the INSTFILES page;
  2. POPUP dialog mode with detailed info;
  3. BANNER mode with simple popup window.

Plug-in recognizes Installer's Silent mode and this case hides any output (this feature requires NSIS 2.03 or later). Program implements simple re-get functionality - host reconnect and download from current position after short pause. While program depends on IE settings, it changes current IE mode to online. NSISdl code fragment was used for progress bar displaying in the "old style" mode.

Command line parameters (NSIS script)

InetLoad::load [/PROXY IP:PORT] [/USERNAME PROXY_LOGIN /PASSWORD PROXY_PASSWD]
[/NOPROXY] [/NOCANCEL] [/POST TEXT2POST] [/TIMEOUT INT_MS] [/SILENT TEXT2DISPLAY]
[/RESUME RETRY_QUESTION] [/POPUP PREFIX | /BANNER CAPTION TEXT] [/TRANSLATE LANG_PARAMS]
URL1 local_file1 [URL2 local_file2 [...]] [/END]
/PROXY
Overwrites current proxy settings, not required in most cases. IE settings will be used by default.
/USERNAME
Proxy username (http only).
/PASSWORD
Proxy password (http only). For server (http/ftp) authentication it is possible to use URL encoded name and password, for example http://username:password@nsis.sourceforge.net.
/NOPROXY
Disables proxy settings for this connection (if any)
/NOCANCEL
Prevents download from being interrupted by user (locks Esc, Alt-F4, Cancel handling)
/POST
Sets POST http mode and defines text string to be used in the POST (http only). Disables auto re-get. No char replaces used (%20 and others).
/TIMEOUT
Sets INTERNET_OPTION_CONNECT_TIMEOUT, milliseconds, default - IE current parameter value.
/SILENT
Key hides plug-in' output (both popup dialog and embedded progress bar). Sets TEXT2DISPLAY to 1006 control, if /silent "" - displays "InetLoad plug-in" default. Not required if 'SilentInstall silent' mode was defined in script (NSIS 2.03 option).
/RESUME
On the permanent connection/transfer error instead of exit first displays message box with "resume download" question. Useful for dial-up connections and big files - allows user to restore connection and resume download. Default is "Your internet connection seems to have dropped out!\nPlease reconnect and click Retry to resume downloading...".
/POPUP
This mode displays detailed download dialog instead of embedded progress bar. PREFIX parameter sets left part of dialog caption (before '-'), default is "InetLoad plug-in" (if ""). Also useful in .onInit function (i.e. not in Section).
/BANNER
Displays simple popup dialog (MSI Banner mode) and sets dialog CAPTION ("NSIS Installer - InetLoad" is default) and TEXT (up to 3 lines using $\n).
/END
Allows to limit plug-in stack reading (optional, required if you stores other vars in the stack).
/TRANSLATE
Allows translating plug-in text in the POPUP or "old style" (NSISdl) modes (see Readme for parameters). In the BANNER mode text is also customizable.

Examples

InetLoad::load "http://dl.zvuki.ru/6306/mp3/12.mp3" "$EXEDIR\12.mp3" \
               "ftp://dl.zvuki.ru/6306/mp3/11.mp3" "$EXEDIR\11.mp3"
Pop $0
InetLoad::load /BANNER "" "Cameron Diaz download in progress..." \
"http://www.dreamgirlswallpaper.co.uk/fiveyearsonline/wallpaper/Cameron_Diaz/camerond09big.JPG" \
"$EXEDIR\cd.jpg"
  Pop $0
  StrCmp $0 "OK" dlok
  MessageBox MB_OK|MB_ICONEXCLAMATION "Download Error, click OK to abort installation" /SD IDOK
  Abort
dlok:
  ...

Plug-in returns "OK" string if successful, error description string if failed (see included InetLoad.cpp file for a full set of status strings). Usage and result processing samples are included to the package.