No more Windows error message when using IfFileExists on a removable drive with no media inserted - now applies to all internal file_exists calls.

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2976 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
eccles 2003-09-28 12:14:10 +00:00
parent a72067fab9
commit 7d99fd6700
2 changed files with 9 additions and 11 deletions

View file

@ -263,12 +263,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
case EW_IFFILEEXISTS:
{
char *buf0=GetStringFromParm(0x00);
WIN32_FIND_DATA *fd;
// Avoid a "There is no disk in the drive" error box on empty removable drives
SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);
fd = file_exists(buf0);
SetErrorMode(0);
if (fd)
if (file_exists(buf0))
{
log_printf3("IfFileExists: file \"%s\" exists, jumping %d",buf0,parm1);
return parm1;