diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index 64e05268..9e3b95e8 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -1302,7 +1302,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (uMsg == WM_IN_UPDATEMSG) { - RefreshSectionGroups(0); + RefreshSectionGroups(); #if defined(NSIS_SUPPORT_CODECALLBACKS) && defined(NSIS_CONFIG_COMPONENTPAGE) if (wParam) @@ -1347,7 +1347,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar } // end of typecheckshit } - RefreshSectionGroups(0); + RefreshSectionGroups(); RefreshComponents(hwndTree1, hTreeItems); if (LANG_STR_TAB(LANG_SPACE_REQ)) { diff --git a/Source/exehead/components.c b/Source/exehead/components.c index 27a87c76..50263431 100644 --- a/Source/exehead/components.c +++ b/Source/exehead/components.c @@ -34,7 +34,7 @@ void NSISCALL SectionFlagsChanged(unsigned int index) { } } -unsigned int NSISCALL RefreshSectionGroups(unsigned int i) { +static unsigned int NSISCALL _RefreshSectionGroups(unsigned int i, int first_call) { unsigned int selected = 0; unsigned int not_selected = 0; @@ -43,8 +43,10 @@ unsigned int NSISCALL RefreshSectionGroups(unsigned int i) { unsigned int sec = i; if (sections[sec].flags & SF_SECGRP) { - sections[sec].flags &= ~(SF_SELECTED | SF_PSELECTED); - i++; + if (!first_call) { + sections[sec].flags &= ~(SF_SELECTED | SF_PSELECTED); + i++; + } } while (i < (unsigned int) num_sections) { @@ -52,7 +54,7 @@ unsigned int NSISCALL RefreshSectionGroups(unsigned int i) { int ni = i + 1; if (flags & SF_SECGRP) { - ni = RefreshSectionGroups(i); + ni = _RefreshSectionGroups(i, 0); } if (flags & SF_SECGRPEND) { @@ -84,6 +86,10 @@ unsigned int NSISCALL RefreshSectionGroups(unsigned int i) { return 0; } +void NSISCALL RefreshSectionGroups() { + _RefreshSectionGroups(0, 1); +} + void NSISCALL SetInstType(int inst_type) { unsigned int i = 0; diff --git a/Source/exehead/components.h b/Source/exehead/components.h index 40764713..b5a93497 100644 --- a/Source/exehead/components.h +++ b/Source/exehead/components.h @@ -2,7 +2,7 @@ #define ___COMPONENTS_H___ void NSISCALL SectionFlagsChanged(unsigned int index); -unsigned int NSISCALL RefreshSectionGroups(unsigned int i); +void NSISCALL RefreshSectionGroups(); void NSISCALL SetInstType(int inst_type); unsigned int NSISCALL GetInstType(HTREEITEM *items); diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c index 45730ae3..af58eefe 100644 --- a/Source/exehead/exec.c +++ b/Source/exehead/exec.c @@ -1508,7 +1508,7 @@ static int NSISCALL ExecuteEntry(entry *entry_) if (parm2) // set install type { SetInstType(x); - RefreshSectionGroups(0); + RefreshSectionGroups(); } else // get install type {