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 7ad7ae43..55470e7c 100644 Binary files a/Plugins/nsisdl.dll and b/Plugins/nsisdl.dll differ