From f345a4256d4550f8c007f339bc62d12b5b8000ae Mon Sep 17 00:00:00 2001 From: kichik Date: Thu, 29 Aug 2002 12:25:19 +0000 Subject: [PATCH] Still 36.5KB :D git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@821 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/Ui.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index 6db31380..a7b71486 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -58,6 +58,8 @@ HWND g_progresswnd; static char g_tmp[4096]; +static int num_sections; + // sent to the last child window to tell it that the install thread is done #define WM_NOTIFY_INSTPROC_DONE (WM_USER+0x4) @@ -284,6 +286,7 @@ lang_again: int NSISCALL ui_doinstall(void) { + num_sections=g_inst_header->num_sections; g_autoclose=g_inst_cmnheader->misc_flags&1; #ifdef NSIS_CONFIG_UNINSTALL_SUPPORT if (!g_is_uninstaller) @@ -815,7 +818,7 @@ static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (r > v) r=v; available=(int)r; } - for (x = 0; x < g_inst_header->num_sections; x ++) + for (x = 0; x < num_sections; x ++) { #ifdef NSIS_CONFIG_COMPONENTPAGE if (g_inst_section[x].default_state&DFS_SET) @@ -923,7 +926,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar HBITMAP hBMcheck1; int x; if (hTreeItems) GlobalFree(hTreeItems); - hTreeItems=(HTREEITEM*)GlobalAlloc(GPTR,sizeof(HTREEITEM)*g_inst_header->num_sections); + hTreeItems=(HTREEITEM*)GlobalAlloc(GPTR,sizeof(HTREEITEM)*num_sections); hBMcheck1=LoadBitmap(g_hInstance, MAKEINTRESOURCE(IDB_BITMAP1)); SetUITextFromLang(hwndDlg,IDC_INTROTEXT,g_inst_header->common.intro_text_id,LANGID_COMP_TEXT); @@ -960,7 +963,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar Par=NULL; - for (x = 0; x < g_inst_header->num_sections; x ++) + for (x = 0; x < num_sections; x ++) { if (g_inst_section[x].name_ptr>=0) { @@ -1024,7 +1027,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar } } } - for (x = 0; x < g_inst_header->num_sections; x ++) + for (x = 0; x < num_sections; x ++) { if (g_inst_section[x].name_ptr>=0 && g_inst_section[x].expand==1) { @@ -1117,7 +1120,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar // check to see which install type we are for (r = 0; r < m_num_insttypes; r ++) { - for (x = 0; x < g_inst_header->num_sections; x ++) + for (x = 0; x < num_sections; x ++) { char c=GetStringFromStringTab(g_inst_section[x].name_ptr)[0]; if (c && c!='-') @@ -1137,7 +1140,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar } } } - if (x == g_inst_header->num_sections) break; + if (x == num_sections) break; } if (!g_inst_header->no_custom_instmode_flag) @@ -1169,7 +1172,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (m_whichcfg != m_num_insttypes) { int x; - for (x = 0; x < g_inst_header->num_sections; x ++) + for (x = 0; x < num_sections; x ++) { if (g_inst_section[x].name_ptr>=0) { @@ -1217,7 +1220,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (LANG_SPACE_REQ >= 0) { int x,total; char s[128]; - for (total=x=0; x < g_inst_header->num_sections; x ++) + for (total=x=0; x < num_sections; x ++) { if (g_inst_section[x].default_state&DFS_SET) total+=g_inst_section[x].size_kb; @@ -1274,7 +1277,7 @@ static DWORD WINAPI install_thread(LPVOID p) { #endif int m_inst_sec=0; - while (m_inst_secnum_sections && !m_abort) + while (m_inst_secnum_sections; x ++) + for (; x < num_sections; x ++) { #ifdef NSIS_CONFIG_COMPONENTPAGE if (g_inst_section[x].default_state&DFS_SET)