diff --git a/Contrib/InstallOptions/InstallerOptions.cpp b/Contrib/InstallOptions/InstallerOptions.cpp index 55d1da95..f29b855a 100644 --- a/Contrib/InstallOptions/InstallerOptions.cpp +++ b/Contrib/InstallOptions/InstallerOptions.cpp @@ -669,11 +669,7 @@ LRESULT WINAPI WMCommandProc(HWND hWnd, UINT id, HWND hwndCtl, UINT codeNotify) if (pField->nFlags & LBS_NOTIFY) { // Remember which control was activated then pretend the user clicked Next g_NotifyField = nIdx + 1; - // the next button must be enabled or nsis will ignore WM_COMMAND - BOOL bWasDisabled = EnableWindow(hNextButton, TRUE); - FORWARD_WM_COMMAND(hMainWindow, IDOK, hNextButton, BN_CLICKED, mySendMessage); - if (bWasDisabled) - EnableWindow(hNextButton, FALSE); + mySendMessage(hMainWindow, WM_NOTIFY_OUTER_NEXT, 1, 0); } } break; diff --git a/Plugins/InstallOptions.dll b/Plugins/InstallOptions.dll index 52651bd8..f274579a 100644 Binary files a/Plugins/InstallOptions.dll and b/Plugins/InstallOptions.dll differ diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index 60872e23..3c8c0be6 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -50,16 +50,15 @@ int progress_bar_pos, progress_bar_len; static char g_tmp[4096]; -static int m_page=-1,m_retcode,m_delta=1; +static int m_page=-1,m_retcode; static page *g_this_page; #define NOTIFY_BYE_BYE 'x' -static void NSISCALL outernotify(char num) { - if (num==NOTIFY_BYE_BYE) +static void NSISCALL outernotify(int delta) { + if (delta==NOTIFY_BYE_BYE) g_quit_flag++; - m_delta=num; - SendMessage(g_hwnd,WM_NOTIFY_OUTER_NEXT,(WPARAM)num,0); // it sends num again for plugins - DON'T REMOVE! + SendMessage(g_hwnd,WM_NOTIFY_OUTER_NEXT,(WPARAM)delta,0); } #ifdef NSIS_CONFIG_VISIBLE_SUPPORT @@ -404,6 +403,7 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) if (uMsg == WM_INITDIALOG || uMsg == WM_NOTIFY_OUTER_NEXT) { page *this_page; + int delta = (int) wParam; static DLGPROC winprocs[]= { #ifdef NSIS_CONFIG_LICENSEPAGE @@ -430,6 +430,7 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) g_quit_flag = ExecuteCodeSegment(g_header->code_onGUIInit,NULL); #endif //ShowWindow(hwndDlg, SW_SHOW); + delta = 1; } this_page=g_pages+m_page; @@ -438,7 +439,7 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) #ifdef NSIS_SUPPORT_CODECALLBACKS // Call leave function. If Abort used don't move to the next page. // But if quit called we must exit now - if (m_delta==1) if (ExecuteCodeSegment(this_page->leavefunc,NULL)) return !g_quit_flag; + if (delta==1) if (ExecuteCodeSegment(this_page->leavefunc,NULL)) return !g_quit_flag; #endif // if the last page was a custom page, wait for it to finish by itself. @@ -450,8 +451,8 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) NotifyCurWnd(WM_NOTIFY_INIGO_MONTOYA); nextPage: - m_page+=m_delta; - this_page+=m_delta; + m_page+=delta; + this_page+=delta; #ifdef NSIS_SUPPORT_CODECALLBACKS if (m_page==g_blocks[NB_PAGES].num) ExecuteCodeSegment(g_header->code_onInstSuccess,NULL); diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c index 013381d5..b3bb87a4 100644 --- a/Source/exehead/exec.c +++ b/Source/exehead/exec.c @@ -146,8 +146,7 @@ static int NSISCALL ExecuteEntry(entry *entry_) int exec_error = 0; - entry lent; - mini_memcpy(&lent, entry_, sizeof(entry)); + entry lent = *entry_; #define which (lent.which) #define parm0 (lent.offsets[0]) diff --git a/Source/exehead/util.c b/Source/exehead/util.c index f99aacec..c5e3a072 100644 --- a/Source/exehead/util.c +++ b/Source/exehead/util.c @@ -243,7 +243,7 @@ char * NSISCALL mystrstri(char *a, char *b) return NULL; } -void * NSISCALL mini_memcpy(void *out, const void *in, int len) +void NSISCALL mini_memcpy(void *out, const void *in, int len) { char *c_out=(char*)out; char *c_in=(char *)in; @@ -251,7 +251,6 @@ void * NSISCALL mini_memcpy(void *out, const void *in, int len) { *c_out++=*c_in++; } - return out; } diff --git a/Source/exehead/util.h b/Source/exehead/util.h index 95fed0f6..0ec9980b 100644 --- a/Source/exehead/util.h +++ b/Source/exehead/util.h @@ -67,7 +67,7 @@ char * NSISCALL skip_root(char *path); int NSISCALL is_valid_instpath(char *s); char * NSISCALL validate_filename(char *fn); void NSISCALL MoveFileOnReboot(LPCTSTR pszExisting, LPCTSTR pszNew); -void * NSISCALL mini_memcpy(void *out, const void *in, int len); +void NSISCALL mini_memcpy(void *out, const void *in, int len); // Turn a pair of chars into a word // Turn four chars into a dword