From 7d6958e253a0117fca7f0bfd537b2cebf540ff7b Mon Sep 17 00:00:00 2001 From: kichik Date: Wed, 16 Jul 2003 18:03:07 +0000 Subject: [PATCH] fixed CreateDirectory error flag git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2723 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/exec.c | 8 ++++++-- TODO.txt | 2 -- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c index 60847a39..604cfcec 100644 --- a/Source/exehead/exec.c +++ b/Source/exehead/exec.c @@ -248,12 +248,16 @@ static int NSISCALL ExecuteEntry(entry *entry_) else break; while (c) { + WIN32_FIND_DATA *fd; while (*p != '\\' && *p) p=CharNext(p); c=*p; *p=0; - if (!file_exists(buf1)) { - g_flags.exec_error += !CreateDirectory(buf1,NULL); + fd = file_exists(buf1); + if (!fd) { + if (!CreateDirectory(buf1,NULL)) + g_flags.exec_error++; } + else if ((fd->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) g_flags.exec_error++; *p++ = c; } } diff --git a/TODO.txt b/TODO.txt index 6f69a08b..81ddbd37 100644 --- a/TODO.txt +++ b/TODO.txt @@ -4,8 +4,6 @@ TODO NSIS -* CreateDirectory error flag on files found instead of dirs - * SetCurInstType should work without the components page * component page for uninstaller, multiple sections