1
0
mirror of https://github.com/greenshot/greenshot.git synced 2025-03-12 05:25:25 -07:00

Added call to the PortableApps.comInstaller

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2588 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2013-04-24 12:12:56 +00:00
parent 2bd315ddc7
commit 37ae1d914a
266 changed files with 4029 additions and 0 deletions
Greenshot/tools/PortableApps.comInstaller/App/nsis
Bin
Contrib

@ -0,0 +1,116 @@
#ifndef _EXDLL_H_
#define _EXDLL_H_
// only include this file from one place in your DLL.
// (it is all static, if you use it in two places it will fail)
#define EXDLL_INIT() { \
g_stringsize=string_size; \
g_stacktop=stacktop; \
g_variables=variables; }
// For page showing plug-ins
#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8)
#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd)
#define NOTIFY_BYE_BYE 'x'
typedef struct _stack_t {
struct _stack_t *next;
TCHAR text[1]; // this should be the length of string_size
} stack_t;
static unsigned int g_stringsize;
static stack_t **g_stacktop;
static TCHAR *g_variables;
static int __stdcall popstring(TCHAR *str); // 0 on success, 1 on empty stack
static void __stdcall pushstring(const TCHAR *str);
enum
{
INST_0, // $0
INST_1, // $1
INST_2, // $2
INST_3, // $3
INST_4, // $4
INST_5, // $5
INST_6, // $6
INST_7, // $7
INST_8, // $8
INST_9, // $9
INST_R0, // $R0
INST_R1, // $R1
INST_R2, // $R2
INST_R3, // $R3
INST_R4, // $R4
INST_R5, // $R5
INST_R6, // $R6
INST_R7, // $R7
INST_R8, // $R8
INST_R9, // $R9
INST_CMDLINE, // $CMDLINE
INST_INSTDIR, // $INSTDIR
INST_OUTDIR, // $OUTDIR
INST_EXEDIR, // $EXEDIR
INST_LANG, // $LANGUAGE
__INST_LAST
};
typedef struct {
int autoclose;
int all_user_var;
int exec_error;
int abort;
int exec_reboot;
int reboot_called;
int cur_insttype;
int insttype_changed;
int silent;
int instdir_error;
int rtl;
int errlvl;
} exec_flags;
typedef struct {
exec_flags *exec_flags;
int (__stdcall *ExecuteCodeSegment)(int, HWND);
} extra_parameters;
// utility functions (not required but often useful)
static int __stdcall popstring(TCHAR *str)
{
stack_t *th;
if (!g_stacktop || !*g_stacktop) return 1;
th=(*g_stacktop);
lstrcpy(str,th->text);
*g_stacktop = th->next;
GlobalFree((HGLOBAL)th);
return 0;
}
static void __stdcall pushstring(const TCHAR *str)
{
stack_t *th;
if (!g_stacktop) return;
th=(stack_t*)GlobalAlloc(GPTR,sizeof(stack_t)+g_stringsize*sizeof(TCHAR));
lstrcpyn(th->text,str,g_stringsize);
th->next=*g_stacktop;
*g_stacktop=th;
}
static TCHAR * __stdcall getuservariable(const int varnum)
{
if (varnum < 0 || varnum >= __INST_LAST) return NULL;
return g_variables+varnum*g_stringsize;
}
static void __stdcall setuservariable(const int varnum, const TCHAR *var)
{
if (var != NULL && varnum >= 0 && varnum < __INST_LAST)
lstrcpy(g_variables + varnum*g_stringsize, var);
}
#endif//_EXDLL_H_

Binary file not shown.

After

(image error) Size: 886 B

Binary file not shown.

After

(image error) Size: 886 B

Binary file not shown.

After

(image error) Size: 886 B

Binary file not shown.

After

(image error) Size: 2.5 KiB

Binary file not shown.

After

(image error) Size: 886 B

Binary file not shown.

After

(image error) Size: 886 B

Binary file not shown.

After

(image error) Size: 1.6 KiB

Binary file not shown.

After

(image error) Size: 886 B

Binary file not shown.

After

(image error) Size: 886 B

Binary file not shown.

After

(image error) Size: 1.6 KiB

Binary file not shown.

After

(image error) Size: 1.8 KiB

Binary file not shown.

After

(image error) Size: 1.6 KiB

Binary file not shown.

After

(image error) Size: 9.5 KiB

Binary file not shown.

After

(image error) Size: 9.5 KiB

Binary file not shown.

After

(image error) Size: 9.5 KiB

Binary file not shown.

After

(image error) Size: 9.5 KiB

Binary file not shown.

After

(image error) Size: 9.5 KiB

Binary file not shown.

After

(image error) Size: 9.5 KiB

Binary file not shown.

After

(image error) Size: 9.5 KiB

Binary file not shown.

After

(image error) Size: 9.5 KiB

Binary file not shown.

After

(image error) Size: 9.5 KiB

Binary file not shown.

After

(image error) Size: 9.5 KiB

Binary file not shown.

After

(image error) Size: 9.5 KiB

Binary file not shown.

After

(image error) Size: 4.6 KiB

Binary file not shown.

After

(image error) Size: 4.6 KiB

Binary file not shown.

After

(image error) Size: 4.6 KiB

Binary file not shown.

After

(image error) Size: 4.6 KiB

Binary file not shown.

After

(image error) Size: 4.6 KiB

Binary file not shown.

After

(image error) Size: 4.6 KiB

Binary file not shown.

After

(image error) Size: 1.1 KiB

Binary file not shown.

After

(image error) Size: 1.1 KiB

Binary file not shown.

After

(image error) Size: 2.2 KiB

Binary file not shown.

After

(image error) Size: 2.2 KiB

Binary file not shown.

After

(image error) Size: 14 KiB

Binary file not shown.

After

(image error) Size: 23 KiB

Binary file not shown.

After

(image error) Size: 14 KiB

Binary file not shown.

After

(image error) Size: 14 KiB

Binary file not shown.

After

(image error) Size: 23 KiB

Binary file not shown.

After

(image error) Size: 14 KiB

Binary file not shown.

After

(image error) Size: 1.1 KiB

Binary file not shown.

After

(image error) Size: 1.1 KiB

Binary file not shown.

After

(image error) Size: 25 KiB

Binary file not shown.

After

(image error) Size: 25 KiB

Binary file not shown.

After

(image error) Size: 25 KiB

Binary file not shown.

After

(image error) Size: 25 KiB

Binary file not shown.

After

(image error) Size: 5.3 KiB

Binary file not shown.

After

(image error) Size: 5.3 KiB

Binary file not shown.

After

(image error) Size: 1.1 KiB

Binary file not shown.

After

(image error) Size: 1.1 KiB

Binary file not shown.

After

(image error) Size: 51 KiB

Binary file not shown.

After

(image error) Size: 26 KiB

Binary file not shown.

After

(image error) Size: 26 KiB

Binary file not shown.

After

(image error) Size: 26 KiB

Binary file not shown.

After

(image error) Size: 51 KiB

Binary file not shown.

After

(image error) Size: 51 KiB

Binary file not shown.

After

(image error) Size: 51 KiB

Binary file not shown.

After

(image error) Size: 51 KiB

Binary file not shown.

After

(image error) Size: 26 KiB

@ -0,0 +1,53 @@
;--------------------------------
; General Attributes
Name "Inetc plug-in Test"
OutFile "inetc.exe"
;SilentInstall silent
;--------------------------------
;Interface Settings
!include "MUI.nsh"
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-colorful.ico"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
;SetFont 14
;--------------------------------
;Installer Sections
Section "Dummy Section" SecDummy
SetDetailsView hide
; two files download, popup mode
inetc::get /caption "2003-2004 reports" /popup "" "http://ineum.narod.ru/spr_2003.htm" "$EXEDIR\spr3.htm" "http://ineum.narod.ru/spr_2004.htm" "$EXEDIR\spr4.htm" /end
Pop $0 # return value = exit code, "OK" means OK
; single file, NSISdl-style embedded progress bar with specific cancel button text
inetc::get /caption "2005 report" /canceltext "interrupt!" "http://ineum.narod.ru/spr_2005.htm" "$EXEDIR\spr5.htm" /end
Pop $1 # return value = exit code, "OK" means OK
; banner with 2 text lines and disabled Cancel button
inetc::get /caption "2006 report" /banner "Banner mode with /nocancel option setten$\nSecond Line" /nocancel "http://ineum.narod.ru/spr_2006.htm" "$EXEDIR\spr6.htm" /end
Pop $2 # return value = exit code, "OK" means OK
MessageBox MB_OK "Download Status: $0, $1, $2"
SectionEnd
;--------------------------------
;Installer Functions
Function .onInit
; plug-in auto-recognizes 'no parent dlg' in onInit and works accordingly
; inetc::head /RESUME "Network error. Retry?" "http://ineum.narod.ru/spr_2003.htm" "$EXEDIR\spr3.txt"
; Pop $4
FunctionEnd

@ -0,0 +1,140 @@
<div style="border:solid 1px black;padding:10px;width:300px">
<h2>Contents</h2>
<UL>
<LI>1 Links
<LI>2 Description
<LI>3 Command line
<UL>
<LI>3.1 get DLL Function
<LI>3.2 post DLL Function
<LI>3.3 head DLL Function
<LI>3.4 put DLL Function
</UL>
<LI>4 Examples
<LI>5 Credits
</UL>
</div>
<h2>Links</h2>
Download: <a href="http://nsis.sourceforge.net/Inetc_plug-in">http://nsis.sourceforge.net/Inetc_plug-in</a>
<h2>Description</h2>
Internet client plug-in for files download and upload. Based on the InetLoad plug-in.
Network implementation uses MS WinInet API, supports http/https and ftp protocols.
Plugin has better proxy support compare to NSISdl plug-in. Command line may include
few URL/File pairs to be transfered. If server or proxy login/password are not setten in the script,
displays IE-style authentication dialog (except silent mode). Plug-in supports 3
"transfer in progress" display modes:
<UL>
<LI>old NSISdl style - additional embedded progress bar and text on the INSTFILES page;
<LI>POPUP dialog mode with detailed info;
<LI>BANNER mode with simple popup window.
</UL>
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. For ftp use "host/path" for file location relative to user's home dir and
"host//path" for absolute path.
<h2>Command line</h2>
Plug-in DLL functions (entry points): get, post, head, put
<h3>get DLL Function </h3>
<i>inetc::get [/PROXY IP:PORT] [/USERNAME PROXY_LOGIN /PASSWORD PROXY_PASSWD] [/NOCOOKIES]
[/NOPROXY] [/NOCANCEL] [/CONNECTTIMEOUT TO_SEC] [/RECEIVETIMEOUT TO_SEC] [/SILENT]
[/CAPTION TEXT] [/NOCOOKIES] [/RESUME RETRY_QUESTION] [/POPUP HOST_ALIAS | /BANNER TEXT]
[/CANCELTEXT CANCEL_TEXT] [/QUESTION CANCEL_QUESTION] [/USER_AGENT USER_AGENT_TEXT]
[/HEADER HEADER_TEXT] [/TRANSLATE LANG_PARAMS]
URL1 local_file1 [URL2 local_file2 [...]] [/END]</i>
<p>This call 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.
<p>/PROXY -
Overwrites current proxy settings, not required in most cases. IE settings will be used by default.
<p>/USERNAME -
Proxy username (http only).
<p>/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.
<p>/NOPROXY -
Disables proxy settings for this connection (if any)
<p>/NOCANCEL -
Prevents download from being interrupted by user (locks Esc, Alt-F4, Cancel handling, removes sysmenu)
<p>/CONNECTTIMEOUT -
Sets INTERNET_OPTION_CONNECT_TIMEOUT, seconds, default - IE current parameter value.
<p>/RECEIVETIMEOUT -
Sets INTERNET_OPTION_RECEIVE_TIMEOUT, seconds, default - IE current parameter value.
<p>/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 or later).
<p>/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...".
<p>/CAPTION -
Defines caption text for /BANNER mode, caption prefix (left of '-') for /POPUP mode and caption for RESUME MessageBox. Default is "InetLoad plug-in" if not set or "". 127 chars maximum.
<p>/POPUP -
This mode displays detailed download dialog instead of embedded progress bar. Also useful in .onInit function (i.e. not in Section). If HOST_ALIAS is not "", text will replace URL in the dialog - this allows to hide real URL (including password).
<p>/BANNER -
Displays simple popup dialog (MSI Banner mode) and sets dialog TEXT (up to 3 lines using $\n).
<p>/CANCELTEXT -
Text for the Cancel button in the NSISdl mode. Default is NSIS dialog Cancel button text (current lang).
<p>/QUESTION -
Text for the optional MessageBox if user tries to cancel download. If /QUESTION "" was used default
"Are you sure that you want to stop download?" will be substituted.
<p>/USERAGENT -
UserAgent http request header value. Default is "NSIS_Inetc (Mozilla)". 256 chars maximum.
<p>/HEADER -
Adds or replaces http request header. Common HEADER_TEXT format is "header: value".
<p>/NOCOOKIES -
Removes cookies from http request
<p>/END -
Allows to limit plug-in stack reading (optional, required if you stores other vars in the stack).
<p>/TRANSLATE -
Allows translating plug-in text in the POPUP or NSISdl modes. 8 parameters both cases.<br>
NSISdl mode parameters:<br>
/TRANSLATE downloading connecting second minute hour plural progress remaining<br>
With default values:<br>
"Downloading %s" "Connecting ..." second minute hour s "%dkB (%d%%) of %dkB @ %d.%01dkB/s" "(%d %s%s remaining)"<br>
POPUP mode parameters:<br>
/TRANSLATE url downloading connecting file_name received file_size remaining_time total_time<br>
With default values:<br>
URL Downloading Connecting "File Name" Received "File Size" "Remaining Time" "Total Time"<br>
<h3>post DLL Function </h3>
<i>inetc::post TEXT2POST [/FILE] [/PROXY IP:PORT] [/NOPROXY] [/NOCANCEL]
[/USERNAME PROXY_LOGIN /PASSWORD PROXY_PASSWD] [/TIMEOUT INT_MS] [/SILENT]
[/CAPTION TEXT] [/POPUP | /BANNER TEXT] [/CANCELTEXT CANCEL_TEXT]
[/USER_AGENT USER_AGENT_TEXT] [/TRANSLATE LANG_PARAMS]
URL1 local_file1 [URL2 local_file2 [...]] [/END]</i>
<p>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).
If /FILE presents in command line, TEXT2POST is filename to be sent in POST request. Also 'Filename:' header will be added to HTTP headers.
<h3>head DLL Function </h3>
The same as get, but requests http headers only. Writes raw headers to file.
<h3>put DLL Function </h3>
<i>inetc::put [/PROXY IP:PORT] [/USERNAME PROXY_LOGIN /PASSWORD PROXY_PASSWD] [/NOPROXY]
[/NOCANCEL] [/TIMEOUT INT_MS] [/SILENT] [/CAPTION TEXT] [/POPUP | /BANNER TEXT]
[/CANCELTEXT CANCEL_TEXT] [/USER_AGENT USER_AGENT_TEXT]
[/TRANSLATE LANG_PARAMS] URL1 local_file1 [URL2 local_file2 [...]] [/END]</i>
<p>Return value and parameters (if applicable) are the same as for previous entry point.
<h2>Examples </h2>
<pre> inetc::get "http://dl.zvuki.ru/6306/mp3/12.mp3" "$EXEDIR\12.mp3" \
"ftp://dl.zvuki.ru/6306/mp3/11.mp3" "$EXEDIR\11.mp3"
Pop $0
inetc::put /BANNER "Cameron Diaz upload 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 "http upload Error, click OK to abort installation" /SD IDOK
Abort
dlok:
...</pre>
<h2>Credits</h2>
Many thanks to Backland who offered a simple way to fix NSISdl mode crashes and added 'center parent' function.

@ -0,0 +1,31 @@
;--------------------------------
; General Attributes
Name "Inetc http auth Test"
OutFile "auth_dlg.exe"
;--------------------------------
;Interface Settings
!include "MUI.nsh"
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-colorful.ico"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
Section "Dummy Section" SecDummy
; Displays IE auth dialog.
; Both server and proxy auth.
; Please test this with your own link.
inetc::get "http://www.cnt.ru/personal" "$EXEDIR\auth.html"
Pop $0 # return value = exit code, "OK" if OK
MessageBox MB_OK "Download Status: $0"
SectionEnd

@ -0,0 +1,31 @@
;--------------------------------
; General Attributes
Name "Inetc ftp authentication Test"
OutFile "ftp_auth.exe"
;--------------------------------
;Interface Settings
!include "MUI.nsh"
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-colorful.ico"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
Section "Dummy Section" SecDummy
; use your own URL and login@pwd. Password hidden from user with /popup "ALIAS"
inetc::get /caption "service pack download" /popup "ftp://localhost/" "ftp://login:pwd@localhost/W2Ksp3.exe" "$EXEDIR\sp3.exe"
; inetc::put /caption "service pack upload" /popup "" "ftp://login:pwd@localhost/W2Ksp3.bu.exe" "$EXEDIR\sp3.exe"
Pop $0 # return value = exit code, "OK" if OK
MessageBox MB_OK "Download Status: $0"
SectionEnd

@ -0,0 +1,29 @@
;--------------------------------
; General Attributes
Name "Inetc Head Test"
OutFile "head.exe"
;--------------------------------
;Interface Settings
!include "MUI.nsh"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
Section "Dummy Section" SecDummy
DetailPrint "New version check out (internet connection)"
inetc::head /silent "http://ineum.narod.ru/spr_2006.htm" "$EXEDIR\head.txt"
Pop $0 # return value = exit code, "OK" if OK
MessageBox MB_OK "Download Status: $0"
SectionEnd

@ -0,0 +1,31 @@
;--------------------------------
; General Attributes
Name "Headers Test"
OutFile "headers.exe"
;--------------------------------
;Interface Settings
!include "MUI.nsh"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
Section "Dummy Section" SecDummy
; additional headers. Sample php returns raw headers
inetc::get /useragent "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1)" /header "SOAPAction: urn:anonOutInOpe" "http://localhost/headers.php" "$EXEDIR\headers.html"
Pop $0
MessageBox MB_OK "Download Status: $0"
SectionEnd

@ -0,0 +1,7 @@
<?php
$headers = apache_request_headers();
foreach ($headers as $header => $value) {
echo "$header: $value <br />\n";
}
?>

@ -0,0 +1,26 @@
;--------------------------------
; General Attributes
Name "Inetc https Test"
OutFile "https.exe"
;--------------------------------
;Interface Settings
!include "MUI.nsh"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
Section "Dummy Section" SecDummy
inetc::get /POPUP "" /CAPTION "bending_property_demo.zip" "https://secure.codeproject.com/cs/miscctrl/bending_property/bending_property_src.zip" "$EXEDIR\bending_property_src.zip"
Pop $0 # return value = exit code, "OK" if OK
MessageBox MB_OK "Download Status: $0"
SectionEnd

File diff suppressed because it is too large Load Diff

@ -0,0 +1,175 @@
# Microsoft Developer Studio Project File - Name="inetc" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=inetc - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "inetc.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "inetc.mak" CFG="inetc - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "inetc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "inetc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "inetc - Win32 Release_Unicode" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "inetc - Win32 Debug_Unicode" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "inetc - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "debug"
# PROP Intermediate_Dir "debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "inetc_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\ExDll" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "inetc_EXPORTS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 msvcrt.lib kernel32.lib user32.lib gdi32.lib wininet.lib comctl32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /nodefaultlib /out:"..\..\plugins\inetc.dll" /opt:nowin98
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "inetc - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "inetc_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\ExDll" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "inetc_EXPORTS" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib wininet.lib comctl32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\plugins\inetc.dll" /pdbtype:sept
# SUBTRACT LINK32 /incremental:no /debug
!ELSEIF "$(CFG)" == "inetc - Win32 Release_Unicode"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release_Unicode"
# PROP BASE Intermediate_Dir "Release_Unicode"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Debug_Unicode"
# PROP Intermediate_Dir "Debug_Unicode"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /D "_USRDLL" /D "inetc_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\ExDll" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /D "_USRDLL" /D "inetc_EXPORTS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 msvcrt.lib kernel32.lib user32.lib gdi32.lib wininet.lib comctl32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /nodefaultlib /out:"..\..\Unicode\plugins\inetc.dll" /opt:nowin98
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "inetc - Win32 Debug_Unicode"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug_Unicode"
# PROP BASE Intermediate_Dir "Debug_Unicode"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug_Unicode"
# PROP Intermediate_Dir "Debug_Unicode"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /D "_USRDLL" /D "inetc_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\ExDll" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /D "_USRDLL" /D "inetc_EXPORTS" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib wininet.lib comctl32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Unicode\plugins\inetc.dll" /pdbtype:sept
# SUBTRACT LINK32 /incremental:no /debug
!ENDIF
# Begin Target
# Name "inetc - Win32 Release"
# Name "inetc - Win32 Debug"
# Name "inetc - Win32 Release_Unicode"
# Name "inetc - Win32 Debug_Unicode"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\inetc.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE="..\Graphics\Icons\classic-install.ico"
# End Source File
# Begin Source File
SOURCE=.\inetc.rc
# End Source File
# End Group
# End Target
# End Project

@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "ftpc"=".\inetc.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

@ -0,0 +1,170 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Russian resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
#ifdef _WIN32
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
#pragma code_page(1251)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // Russian resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_DIALOG1 DIALOGEX 0, 0, 286, 71
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Inetc plug-in"
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "",IDC_STATIC1,50,4,230,12,SS_CENTERIMAGE,
WS_EX_STATICEDGE
LTEXT "",IDC_STATIC2,50,18,230,12,SS_CENTERIMAGE,
WS_EX_STATICEDGE
CTEXT "",IDC_STATIC3,50,32,102,12,SS_CENTERIMAGE,
WS_EX_STATICEDGE
CTEXT "",IDC_STATIC4,220,32,60,12,SS_CENTERIMAGE,
WS_EX_STATICEDGE
CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",NOT
WS_VISIBLE,5,62,275,7
CTEXT "",IDC_STATIC5,50,46,102,12,SS_CENTERIMAGE,
WS_EX_STATICEDGE
CTEXT "",IDC_STATIC6,220,46,60,12,SS_CENTERIMAGE,
WS_EX_STATICEDGE
CONTROL "URL",IDC_STATIC20,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,
5,6,44,10
CONTROL "File name",IDC_STATIC21,"Static",SS_LEFTNOWORDWRAP |
WS_GROUP,5,20,44,10
CONTROL "Transfered",IDC_STATIC22,"Static",SS_LEFTNOWORDWRAP |
WS_GROUP,5,34,44,10
CONTROL "File size",IDC_STATIC23,"Static",SS_LEFTNOWORDWRAP |
WS_GROUP,5,48,44,10
CONTROL "Remaining time",IDC_STATIC24,"Static",SS_LEFTNOWORDWRAP |
WS_GROUP,164,34,55,10
CONTROL "Total time",IDC_STATIC25,"Static",SS_LEFTNOWORDWRAP |
WS_GROUP,164,48,55,10
END
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 226, 62
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Inetc plug-in"
FONT 8, "MS Sans Serif"
BEGIN
ICON 103,IDC_STATIC13,4,4,20,20
LTEXT "Please wait",IDC_STATIC12,35,6,184,28
CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",NOT
WS_VISIBLE,12,40,201,11
END
IDD_DIALOG3 DIALOG DISCARDABLE 0, 0, 266, 62
STYLE DS_CONTROL | WS_CHILD | WS_VISIBLE
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",0x0,0,23,
266,11
CTEXT "",IDC_STATIC1,0,8,266,11
PUSHBUTTON "Cancel",IDCANCEL,166,41,80,16
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_DIALOG1, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 279
TOPMARGIN, 7
BOTTOMMARGIN, 64
END
IDD_DIALOG2, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 219
TOPMARGIN, 7
BOTTOMMARGIN, 55
END
IDD_DIALOG3, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 259
TOPMARGIN, 7
BOTTOMMARGIN, 55
END
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

@ -0,0 +1,80 @@
;--------------------------------
; General Attributes
Name "Inetc Local Test"
OutFile "inetc_local.exe"
;--------------------------------
;Interface Settings
!include "MUI.nsh"
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-colorful.ico"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
Section "Dummy Section" SecDummy
; PUT test
; FTP requires anonymous access in sample below.
; HTTP sample put.php included to package. Stores test.jpg as m2.bmp
; check server files present after upload
inetc::put "http://localhost/put.php" "$EXEDIR\test.jpg"
Pop $0
inetc::put "ftp://localhost/test.jpg" "$EXEDIR\test.jpg"
; not anonymous format
; inetc::put "ftp://login:password@localhost/test.jpg" "$EXEDIR\test.jpg"
Pop $1
DetailPrint "PUT: HTTP $0, FTP $1 (verify server files)"
; POST test
; HTTP sample post.php and post_form.htm (to compare results) included
inetc::post "login=ami&passwd=333" "http://localhost/post.php?lg=iam&pw=44" "$EXEDIR\post_reply.htm"
Pop $2
DetailPrint "POST: $2 (post_reply.htm)"
; HEAD test
; uses uploaded earlier test.jpg
inetc::head /silent "http://localhost/m2.bmp" "$EXEDIR\head.txt"
Pop $3
DetailPrint "HEAD: $3 (head.txt)"
; GET test
; 2 files download in nsisdl mode
inetc::get "http://localhost/m2.bmp" "$EXEDIR\get1.jpg" "http://localhost/m2.bmp" "$EXEDIR\get2.jpg"
Pop $4
inetc::get /popup "Localhost:GET with Popup" "http://localhost/m2.bmp" "$EXEDIR\get3.jpg"
Pop $5
inetc::get /banner "Local Test GET with Banner" "http://localhost/m2.bmp" "$EXEDIR\get4.jpg"
Pop $6
inetc::get /silent "ftp://localhost/test.jpg" "$EXEDIR\get5.jpg"
Pop $7
DetailPrint "GET: NSISDL $4, POPUP $5, BANNER $6, FTP $7 (get1-5.jpg)"
SetDetailsView show
SectionEnd

@ -0,0 +1,30 @@
;--------------------------------
; General Attributes
Name "Inetc Post Test"
OutFile "post.exe"
;--------------------------------
;Interface Settings
!include "MUI.nsh"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
Section "Dummy Section" SecDummy
; this is my LAN sample, use your own URL for tests. Sample post.php included
inetc::post "login=ami&passwd=333" "http://localhost/post.php?lg=iam&pw=44" "$EXEDIR\post_reply.htm"
Pop $0 # return value = exit code, "OK" if OK
MessageBox MB_OK "Download Status: $0"
SectionEnd

@ -0,0 +1,13 @@
<html>
<head>
</head>
<body>
<?php
echo "post.login=".$_POST['login']."<br>";
echo "post.passwd=".$_POST['passwd']."<br>";
echo "get.lg=".$_GET['lg']."<br>";
echo "get.pw=".$_GET['pw']."<br>";
?>
</body>
</html>

@ -0,0 +1,30 @@
;--------------------------------
; General Attributes
Name "Inetc Post Test"
OutFile "post_file.exe"
;--------------------------------
;Interface Settings
!include "MUI.nsh"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
Section "Dummy Section" SecDummy
; this is my LAN sample, use your own URL for tests. Sample post.php included
inetc::post "$EXEDIR\inetc.cpp" /file "http://localhost/post_file.php" "$EXEDIR\post_file.htm"
Pop $0 # return value = exit code, "OK" if OK
MessageBox MB_OK "Download Status: $0"
SectionEnd

@ -0,0 +1,10 @@
<?php
$headers = apache_request_headers();
foreach ($headers as $header => $value) {
echo "$header: $value <br />\n";
}
echo "new <br />";
foreach ($_FILES as $key => $value) echo $key . "<>" . $value . "<br/>\n";
echo file_get_contents('php://input');
?>

@ -0,0 +1,18 @@
<html>
<head>
<title>Registration form for post.php test</title>
</head>
<body>
This form sends POST request to server. It was interesting to compare server echo <br>
reply (by included post.php) for this form and InetLoad plug-in - in my <br>
tests server did not see any difference between them :)<br>
<form name="MainLogin" action="/post.php?lg=ami&pw=333" method="post">
<input type="text" name="login" value="" tabindex="1"><br>
<input type="password" name="passwd" value="" tabindex="2"><br>
<input type="submit" name="In" value="Enter" tabindex="3">
</form>
</body>
</html>

@ -0,0 +1,30 @@
;--------------------------------
; General Attributes
Name "Inetc Test"
OutFile "put.exe"
;--------------------------------
;Interface Settings
!include "MUI.nsh"
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-colorful.ico"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
Section "Dummy Section" SecDummy
; this is my LAN sample, use your own URL for tests. Login/pwd hidden from user. Sample put.php (for http request) included
inetc::put "http://localhost/put.php" "$EXEDIR\test.jpg"
; inetc::put /POPUP "ftp://localhost/" /CAPTION "my local ftp upload" "ftp://localhost/test.jpg" "$EXEDIR\test.jpg"
Pop $0
MessageBox MB_OK "Upload Status: $0"
SectionEnd

@ -0,0 +1,19 @@
<?php
/*
PUT data comes in on the stdin stream, which is php://input
for PHP compiled as a module, although most documentation claim
it's php://stdin
*/
$putdata = fopen("php://input", "r");
$fp = fopen("m2.bmp", "w");
$i = 0;
while ($data = fread($putdata, 1024))
{
echo "data pass: " . $i++ . "\n";
fwrite($fp, $data);
}
fflush($fp);
fclose($fp);
fclose($putdata);
copy("m2.bmp", $request_uri);
?>

@ -0,0 +1,64 @@
Name "Inetc Recursive Dir Upload Test"
OutFile "recursive.exe"
!include "MUI.nsh"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
!include "FileFunc.nsh"
!insertmacro GetFileAttributes
var url
var path
Function dirul
Push $0 ; search handle
Push $1 ; file name
Push $2 ; attributes
FindFirst $0 $1 "$path\*"
loop:
StrCmp $1 "" done
${GetFileAttributes} "$path\$1" DIRECTORY $2
IntCmp $2 1 isdir
retry:
Inetc::put $url/$1 "$path\$1" /end
Pop $2
DetailPrint "$2 $path\$1"
StrCmp $2 "OK" cont
MessageBox MB_YESNO "$path\$1 file upload failed. Retry?" IDYES retry
Abort "terminated by user"
Goto cont
isdir:
StrCmp $1 . cont
StrCmp $1 .. cont
Push $path
Push $url
StrCpy $path "$path\$1"
StrCpy $url "$url/$1"
Call dirul
Pop $url
Pop $path
cont:
FindNext $0 $1
Goto loop
done:
FindClose $0
Pop $2
Pop $1
Pop $0
FunctionEnd
Section "Dummy Section" SecDummy
SetDetailsView hide
StrCpy $path "$EXEDIR"
; put is dir in the user's ftp home, use //put for root-relative path
StrCpy $url ftp://takhir:pwd@localhost/put
Call dirul
SetDetailsView show
SectionEnd

@ -0,0 +1,30 @@
;--------------------------------
; General Attributes
Name "Redirect Test"
OutFile "redirect.exe"
;--------------------------------
;Interface Settings
!include "MUI.nsh"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
Section "Dummy Section" SecDummy
SetDetailsView hide
inetc::get "http://localhost/redirect.php" "$EXEDIR\redirect.htm" /end
Pop $1
MessageBox MB_OK "Download Status: $1"
SectionEnd

@ -0,0 +1,6 @@
<?php
/*
Location header sets 302 status
*/
header("Location: http://localhost/index.htm")
?>

@ -0,0 +1,47 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by inetc.rc
//
#define IDC_SLOGIN 8
#define IDC_PROGRESS 10
#define IDC_SUBTEXT 11
#define IDC_SPWD 11
#define IDC_ICON1 12
#define IDD_DIALOG1 101
#define IDI_ICON1 102
#define IDI_ICON2 103
#define IDD_AUTH 104
#define IDI_ICON3 105
#define IDI_ICON4 106
#define IDI_ICON5 107
#define IDD_DIALOG2 108
#define IDI_ICON6 109
#define IDD_DIALOG3 110
#define IDC_STATIC1 1001
#define IDC_STATIC2 1002
#define IDC_STATIC3 1003
#define IDC_STATIC4 1004
#define IDC_PROGRESS1 1005
#define IDC_STATIC5 1006
#define IDC_STATIC6 1007
#define IDC_STATIC12 1008
#define IDC_STATIC13 1009
#define IDC_STATIC20 1009
#define IDC_STATIC21 1010
#define IDC_STATIC22 1011
#define IDC_STATIC23 1012
#define IDC_STATIC24 1013
#define IDC_STATIC25 1014
#define IDC_ELOGIN 1015
#define IDC_EPWD 1016
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 111
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1018
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

@ -0,0 +1,31 @@
;--------------------------------
; General Attributes
Name "Timeout Test"
OutFile "to.exe"
;--------------------------------
;Interface Settings
!include "MUI.nsh"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
Section "Dummy Section" SecDummy
; additional headers. Sample php returns raw headers
inetc::get /receivetimeout 12 "http://localhost/to.php" "$EXEDIR\to.html"
Pop $0
MessageBox MB_OK "Download Status: $0"
SectionEnd

@ -0,0 +1,32 @@
;--------------------------------
; General Attributes
Name "Inetc Translate Test"
OutFile "Translate.exe"
;--------------------------------
;Interface Settings
!include "MUI.nsh"
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-colorful.ico"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "Russian"
;--------------------------------
;Installer Sections
Section "Dummy Section" SecDummy
; This is russian variant. See Readme.txt for a list of parameters.
; Use LangStrings as TRANSLATE parameters for multilang options
inetc::load /POPUP "" /CAPTION "Ôàéë ãàëåðåè" /TRANSLATE "URL" "Çàãðóçêà" "Ïîïûòêà ñîåäèíåíèÿ" "Èìÿ ôàéëà" Ïîëó÷åíî "Ðàçìåð" "Îñòàëîñü" "Ïðîøëî" "http://ineum.narod.ru/g06s.htm" "$EXEDIR\g06s.htm"
Pop $0 # return value = exit code, "OK" if OK
MessageBox MB_OK "Download Status: $0"
SectionEnd

@ -0,0 +1,169 @@
{{PageAuthor|Takhir}}
== Links ==
Download:<br>
<attach>Inetc.zip</attach><br>
[http://forums.winamp.com/showthread.php?threadid=198596 Forum thread]
== Description ==
Internet client plug-in for files download and upload. Based on the InetLoad plug-in. Network implementation uses MS WinInet API, supports http/https and ftp protocols. Plugin has better proxy support compared to NSISdl plug-in. Command line may include few URL/File pairs to be transfered. If server or proxy login/password are not set in the script, it displays IE-style authentication dialog (except silent mode). Plug-in supports 3 "transfer 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 (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.
For ftp use "host/path" for file location relative to user's home dir and
"host//path" for absolute path.
== Command line ==
Plug-in DLL functions (entry points): get, post, head, put
=== get DLL Function ===
<highlight-nsis>inetc::get [/PROXY IP:PORT] [/USERNAME PROXY_LOGIN /PASSWORD PROXY_PASSWD]
[/NOPROXY] [/NOCANCEL] [/CONNECTTIMEOUT TO_SEC] [/RECEIVETIMEOUT TO_SEC] [/SILENT]
[/CAPTION TEXT] [/NOCOOKIES] [/RESUME RETRY_QUESTION] [/POPUP HOST_ALIAS | /BANNER TEXT]
[/CANCELTEXT CANCEL_TEXT] [/QUESTION CANCEL_QUESTION] [/USER_AGENT USER_AGENT_TEXT]
[/HEADER HEADER_TEXT] [/TRANSLATE LANG_PARAMS]
URL1 local_file1 [URL2 local_file2 [...]] [/END]</highlight-nsis>
This call 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.
; /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 <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)
;/CONNECTTIMEOUT -
:Sets INTERNET_OPTION_CONNECT_TIMEOUT, seconds, default - IE current parameter value.
;/RECEIVETIMEOUT -
:Sets INTERNET_OPTION_RECEIVE_TIMEOUT, seconds, default - IE current parameter value.
; /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 or later).
; /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...".
; /CAPTION
: Defines caption text for /BANNER mode, caption prefix (left of '-') for /POPUP mode and caption for RESUME MessageBox. Default is "InetLoad plug-in" if not set or "".
; /POPUP
: This mode displays detailed download dialog instead of embedded progress bar. Also useful in .onInit function (i.e. not in Section). If HOST_ALIAS is not "", text will replace URL in the dialog - this allows to hide real URL (including password).
; /BANNER
: Displays simple popup dialog (MSI Banner mode) and sets dialog TEXT (up to 3 lines using $\n).
; /CANCELTEXT
: Text for the Cancel button in the NSISdl mode. Default is NSIS dialog Cancel button text (current lang).
; /QUESTION
: Text for the optional MessageBox if user tries to cancel download. If /QUESTION "" was used default "Are you sure that you want to stop download?" will be substituted.
; /USERAGENT
: UserAgent http request header value. Default is "NSIS_Inetc (Mozilla)".
; /HEADER
: Adds or replaces http request header. Common HEADER_TEXT format is "header: value".
; /NOCOOKIES
: Removes cookies from http request
; /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.
=== post DLL Function ===
<highlight-nsis>inetc::post TEXT2POST [/PROXY IP:PORT] [/USERNAME PROXY_LOGIN /PASSWORD PROXY_PASSWD]
[/NOPROXY] [/NOCANCEL] [/CONNECTTIMEOUT TO_SEC] [/RECEIVETIMEOUT TO_SEC] [/SILENT]
[/FILE] [/CAPTION TEXT] [/NOCOOKIES] [/POPUP HOST_ALIAS | /BANNER TEXT]
[/CANCELTEXT CANCEL_TEXT] [/USER_AGENT USER_AGENT_TEXT] [/TRANSLATE LANG_PARAMS]
URL1 local_file1 [URL2 local_file2 [...]] [/END]</highlight-nsis>
Sets POST http mode and defines text string or file name to be used in the POST (http only). Disables auto re-get. No char replaces used (%20 and others). /FILE option allows to send TEXT2POST file content to server, additional 'Filename:' header added to request this case.
=== head DLL Function ===
The same as get, but requests http headers only. Writes raw headers to file.
=== put DLL Function ===
<highlight-nsis>inetc::put [/PROXY IP:PORT] [/USERNAME PROXY_LOGIN /PASSWORD PROXY_PASSWD] [/NOPROXY]
[/NOCANCEL] [/CONNECTTIMEOUT TO_SEC] [/RECEIVETIMEOUT TO_SEC] [/SILENT] [/CAPTION TEXT]
[/POPUP HOST_ALIAS | /BANNER TEXT] [/CANCELTEXT CANCEL_TEXT] [/USER_AGENT USER_AGENT_TEXT]
[/TRANSLATE LANG_PARAMS] [/NOCOOKIES]
URL1 local_file1 [URL2 local_file2 [...]] [/END]</highlight-nsis>
Return value and parameters (if applicable) are the same as for previous entry point.
== Examples ==
<highlight-nsis>
inetc::get "http://dl.zvuki.ru/6306/mp3/12.mp3" "$EXEDIR\12.mp3" \
"ftp://dl.zvuki.ru/6306/mp3/11.mp3" "$EXEDIR\11.mp3"
Pop $0
</highlight-nsis>
<highlight-nsis>
inetc::put /BANNER "Cameron Diaz upload 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 "http upload Error, click OK to abort installation" /SD IDOK
Abort
dlok:
...
</highlight-nsis>
<highlight-nsis>
;installer window restoring after silent calls from .onGUIInit
;by Edward Marshall & Jonathan Beddoes
;temporarily makes the installer window topmost so that inetc doesn't drop our focus
Function .onGUIInit
; Get window handle of installer into register 0.
; This only works in onGUIInit! (so you still can't silently call inetc from onInit)
StrCpy $0 $HWNDPARENT
; Make window always-on-top. Yes, this is bad but we are only doing it temporarily!
; This prevents inetc's hidden dialog from getting foreground precedence over the installer.
; This must be done before any inetc calls.
; -1 = HWND_TOPMOST, 3 = SWP_NOSIZE|SWP_NOMOVE
System::Call "user32::SetWindowPos(i r0, i -1, i 0, i 0, i 0, i 0, i 3)"
; Now do whatever you want with inetc.
inetc::head /silent "http://ineum.narod.ru/spr_2006.htm" "$EXEDIR\head.txt"
; Now set the installer window back to normal (not always-on-top).
; -2 = HWND_NOTOPMOST, 3 = SWP_NOSIZE|SWP_NOMOVE
System::Call "user32::SetWindowPos(i r0, i -2, i 0, i 0, i 0, i 0, i 3)"
FunctionEnd
</highlight-nsis>
<highlight-nsis>
; Following attribute also can restore installer Window
; BGGradient 000000 000080 FFFFFF
</highlight-nsis>
== Credits ==
Many thanks to Backland who offered a simple way to fix NSISdl mode crashes, added 'center parent' function, offers few nice design ideas and spent a lot of time testing the plug-in.
[[Category:Plugins]]

Some files were not shown because too many files have changed in this diff Show More