From 053b859a6f125bbe1343a568a062a4cf499e4f69 Mon Sep 17 00:00:00 2001 From: kichik Date: Thu, 12 Apr 2007 20:24:13 +0000 Subject: [PATCH] fixed bug #774966 - CopyFiles return value not working on NT4 Sp6 git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5063 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/exec.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c index 0da321fc..408662d5 100644 --- a/Source/exehead/exec.c +++ b/Source/exehead/exec.c @@ -1064,6 +1064,19 @@ static int NSISCALL ExecuteEntry(entry *entry_) char *buf0=GetStringFromParm(0x00); char *buf1=GetStringFromParm(0x11); log_printf3("CopyFiles \"%s\"->\"%s\"",buf0,buf1); + + if (!file_exists(buf0)) + { + // workaround for bug #774966 + // + // on nt4, SHFileOperation silently fails if the source + // file doesn't exist. do a manual check instead. + + update_status_text(LANG_COPYFAILED,0); + exec_error++; + break; + } + op.hwnd=g_hwnd; op.wFunc=FO_COPY; buf0[mystrlen(buf0)+1]=0;