diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index cb3bf393..860f8d68 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -298,7 +298,6 @@ lang_again: int NSISCALL ui_doinstall(void) { static WNDCLASS wc; // richedit subclassing and bgbg creation - num_sections=g_inst_header->num_sections; g_flags.autoclose=inst_flags&CH_FLAGS_AUTO_CLOSE; #ifdef NSIS_CONFIG_UNINSTALL_SUPPORT if (!g_is_uninstaller) diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c index 48ac83a6..b21e8a19 100644 --- a/Source/exehead/exec.c +++ b/Source/exehead/exec.c @@ -274,7 +274,12 @@ static int NSISCALL ExecuteEntry(entry *entry_) log_printf3("IfFileExists: file \"%s\" does not exist, jumping %d",buf0,parm2); } return parm2; - case EW_IFERRORS: return entry_->offsets[!g_flags.exec_error]; + case EW_IFERRORS: + { + int f=entry_->offsets[!g_flags.exec_error]; + g_flags.exec_error=0; + return f; + } #ifdef NSIS_SUPPORT_RENAME case EW_RENAME: { @@ -694,8 +699,8 @@ static int NSISCALL ExecuteEntry(entry *entry_) case EW_SENDMESSAGE: { int v; - int b3=(int)process_string_fromparm_tobuf(0x03); - int b4=(int)process_string_fromparm_tobuf(0x14); + int b3=(int)process_string_fromparm_tobuf(0x33); + int b4=(int)process_string_fromparm_tobuf(0x44); if (!(parm5&1)) b3=myatoi((char*)b3); if (!(parm5&2)) b4=myatoi((char*)b4); diff --git a/Source/exehead/fileform.c b/Source/exehead/fileform.c index 7f171d82..392d4bab 100644 --- a/Source/exehead/fileform.c +++ b/Source/exehead/fileform.c @@ -108,7 +108,8 @@ const char * NSISCALL loadHeaders(void) #endif { g_inst_section=(section *) (g_inst_header + 1); - g_inst_page=(page *) (g_inst_section + g_inst_header->num_sections); + num_sections=g_inst_header->num_sections; + g_inst_page=(page *) (g_inst_section + num_sections); } g_inst_entry=(entry *) (g_inst_page + g_inst_cmnheader->num_pages); g_db_strtab = (char *) (g_inst_entry + g_inst_cmnheader->num_entries); diff --git a/Source/exehead/util.c b/Source/exehead/util.c index c27401b7..7d38b302 100644 --- a/Source/exehead/util.c +++ b/Source/exehead/util.c @@ -38,7 +38,7 @@ HANDLE NSISCALL myCreateProcess(char *cmd, char *dir) if (d == INVALID_FILE_ATTRIBUTES || !(d&FILE_ATTRIBUTE_DIRECTORY)) dir=0; if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, dir, &StartUp, &ProcInfo)) return NULL; - if (NULL != ProcInfo.hThread) CloseHandle( ProcInfo.hThread ); + CloseHandle(ProcInfo.hThread); return ProcInfo.hProcess; }