From 859235383be0992577c92a6aef53e58076abc38d Mon Sep 17 00:00:00 2001 From: kichik Date: Tue, 26 Jun 2007 18:08:24 +0000 Subject: [PATCH] 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 --- Source/exehead/Main.c | 2 ++ Source/exehead/exec.c | 2 -- Source/exehead/util.c | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Source/exehead/Main.c b/Source/exehead/Main.c index 6dbac444..5002272c 100644 --- a/Source/exehead/Main.c +++ b/Source/exehead/Main.c @@ -65,6 +65,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam, InitCommonControls(); + SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS); + #if defined(NSIS_SUPPORT_ACTIVEXREG) || defined(NSIS_SUPPORT_CREATESHORTCUT) { extern HRESULT g_hres; diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c index f129956b..d4b6bbb3 100644 --- a/Source/exehead/exec.c +++ b/Source/exehead/exec.c @@ -958,7 +958,6 @@ static int NSISCALL ExecuteEntry(entry *entry_) case EW_REGISTERDLL: { exec_error++; - SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS); if (SUCCEEDED(g_hres)) { HANDLE h=NULL; @@ -1015,7 +1014,6 @@ static int NSISCALL ExecuteEntry(entry *entry_) update_status_text_buf1(LANG_NOOLE); log_printf("Error registering DLL: Could not initialize OLE"); } - SetErrorMode(0); } break; #endif diff --git a/Source/exehead/util.c b/Source/exehead/util.c index 04b180ed..dc5c15ef 100644 --- a/Source/exehead/util.c +++ b/Source/exehead/util.c @@ -873,10 +873,7 @@ WIN32_FIND_DATA * NSISCALL file_exists(char *buf) { HANDLE h; 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); - SetErrorMode(0); if (h != INVALID_HANDLE_VALUE) { FindClose(h);