fixed bug #1741061 - use SetErrorMode to disable error messages for the entire installer and not for specific points as it always knows best what messages to display

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5172 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2007-06-26 18:08:24 +00:00
parent a6231ca0c9
commit 859235383b
3 changed files with 2 additions and 5 deletions

View file

@ -65,6 +65,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
InitCommonControls(); InitCommonControls();
SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);
#if defined(NSIS_SUPPORT_ACTIVEXREG) || defined(NSIS_SUPPORT_CREATESHORTCUT) #if defined(NSIS_SUPPORT_ACTIVEXREG) || defined(NSIS_SUPPORT_CREATESHORTCUT)
{ {
extern HRESULT g_hres; extern HRESULT g_hres;

View file

@ -958,7 +958,6 @@ static int NSISCALL ExecuteEntry(entry *entry_)
case EW_REGISTERDLL: case EW_REGISTERDLL:
{ {
exec_error++; exec_error++;
SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);
if (SUCCEEDED(g_hres)) if (SUCCEEDED(g_hres))
{ {
HANDLE h=NULL; HANDLE h=NULL;
@ -1015,7 +1014,6 @@ static int NSISCALL ExecuteEntry(entry *entry_)
update_status_text_buf1(LANG_NOOLE); update_status_text_buf1(LANG_NOOLE);
log_printf("Error registering DLL: Could not initialize OLE"); log_printf("Error registering DLL: Could not initialize OLE");
} }
SetErrorMode(0);
} }
break; break;
#endif #endif

View file

@ -873,10 +873,7 @@ WIN32_FIND_DATA * NSISCALL file_exists(char *buf)
{ {
HANDLE h; HANDLE h;
static WIN32_FIND_DATA fd; static WIN32_FIND_DATA fd;
// Avoid a "There is no disk in the drive" error box on empty removable drives
SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);
h = FindFirstFile(buf,&fd); h = FindFirstFile(buf,&fd);
SetErrorMode(0);
if (h != INVALID_HANDLE_VALUE) if (h != INVALID_HANDLE_VALUE)
{ {
FindClose(h); FindClose(h);