No more Windows error message when using IfFileExists on a removable drive with no media inserted.
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2975 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
2508cbce0c
commit
a72067fab9
1 changed files with 7 additions and 2 deletions
|
@ -263,7 +263,12 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
||||||
case EW_IFFILEEXISTS:
|
case EW_IFFILEEXISTS:
|
||||||
{
|
{
|
||||||
char *buf0=GetStringFromParm(0x00);
|
char *buf0=GetStringFromParm(0x00);
|
||||||
if (file_exists(buf0))
|
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)
|
||||||
{
|
{
|
||||||
log_printf3("IfFileExists: file \"%s\" exists, jumping %d",buf0,parm1);
|
log_printf3("IfFileExists: file \"%s\" exists, jumping %d",buf0,parm1);
|
||||||
return parm1;
|
return parm1;
|
||||||
|
@ -744,7 +749,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
||||||
c->bkb = CreateBrushIndirect(&c->bk);
|
c->bkb = CreateBrushIndirect(&c->bk);
|
||||||
|
|
||||||
c->flags &= ~(CC_BK_SYS|CC_TEXT_SYS|CC_BKB);
|
c->flags &= ~(CC_BK_SYS|CC_TEXT_SYS|CC_BKB);
|
||||||
|
|
||||||
SetWindowLong((HWND) GetIntFromParm(0), GWL_USERDATA, (long) c);
|
SetWindowLong((HWND) GetIntFromParm(0), GWL_USERDATA, (long) c);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue