From a5257b1d2694d53bdbc305e5919826e033d1a111 Mon Sep 17 00:00:00 2001 From: joostverburg Date: Fri, 14 Feb 2003 20:20:35 +0000 Subject: [PATCH] Push instead of writing to $0 git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2158 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/NSISdl/ReadMe.txt | 9 ++++----- Contrib/NSISdl/nsisdl.cpp | 6 +++--- Plugins/nsisdl.dll | Bin 12800 -> 13312 bytes 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Contrib/NSISdl/ReadMe.txt b/Contrib/NSISdl/ReadMe.txt index e9ef1199..2c886a6b 100644 --- a/Contrib/NSISdl/ReadMe.txt +++ b/Contrib/NSISdl/ReadMe.txt @@ -18,25 +18,24 @@ 3. This notice may not be removed or altered from any source distribution. - - 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): You can also pass /TIMEOUT=### to set the timeout in milliseconds - Result is returned in $0 + Result is pushed to the stack "cancel" if cancelled "success" if success - otherwise, an error string describing the error + otherwise, an error string describing the error NSISdl::download http://www.nullsoft.com/free/nsis/nsis198.exe poo.exe or NSISdl::download /TIMEOUT=30000 http://www.nullsoft.com/free/nsis/nsis198.exe poo.exe -then, check $0 for errors: +then, pop a value from the stack and for errors: + Pop $0 StrCmp $0 "success" yay Abort "Error downloading file yay: diff --git a/Contrib/NSISdl/nsisdl.cpp b/Contrib/NSISdl/nsisdl.cpp index 70c2f15a..718c4734 100644 --- a/Contrib/NSISdl/nsisdl.cpp +++ b/Contrib/NSISdl/nsisdl.cpp @@ -393,13 +393,13 @@ __declspec(dllexport) void download (HWND parent, } if (g_cancelled) { - setuservariable(INST_0, "cancel"); + pushstring("cancel"); DeleteFile(filename); } else if (error == NULL) { - setuservariable(INST_0, "success"); + pushstring("success"); } else { DeleteFile(filename); - setuservariable(INST_0, error); + pushstring(error); } delete get; diff --git a/Plugins/nsisdl.dll b/Plugins/nsisdl.dll index 7ad7ae43f950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