Added /TIMEOUT= option
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1047 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
1e9a37e5be
commit
7cc613e50f
3 changed files with 7 additions and 0 deletions
|
@ -25,6 +25,7 @@ This dll can be used from NSIS to download files via http.
|
|||
How to use (for another example, see waplugin.nsi in the nsis directory):
|
||||
|
||||
Pass the url and filename on the stack
|
||||
You can also pass /TIMEOUT=### to set the timeout in milliseconds
|
||||
Result is returned in $0
|
||||
"cancel" if cancelled
|
||||
"success" if success
|
||||
|
@ -37,6 +38,7 @@ Example:
|
|||
; make the call to download
|
||||
Push "http://www.xcf.berkeley.edu/~yaroslav/photos/mike/mike1-full.jpg"
|
||||
Push "$INSTDIR\test.jpg"
|
||||
; Push /TIMEOUT=10000 ; 10 seconds timeout
|
||||
CallInstDLL $TEMP\nsdtmp09.dll download ; for a quiet install, use download_quiet
|
||||
|
||||
; delete DLL from temporary directory
|
||||
|
|
|
@ -355,6 +355,11 @@ __declspec(dllexport) void download (HWND parent,
|
|||
g_stacktop = stacktop;
|
||||
|
||||
popstring (filename);
|
||||
lstrcpyn(buf, filename, 10);
|
||||
if (!lstrcmp(buf, "/TIMEOUT=")) {
|
||||
g_timeout_ms=my_atoi(filename+9);
|
||||
popstring (filename);
|
||||
}
|
||||
popstring (url);
|
||||
|
||||
HANDLE hFile = CreateFile(filename,GENERIC_WRITE,FILE_SHARE_READ,NULL,CREATE_ALWAYS,0,NULL);
|
||||
|
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue