Now only shows the unpacking dialog if the NSIS window hasn't been created yet

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1113 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2002-09-21 15:17:42 +00:00
parent 1d98414847
commit fc2c45cb92
2 changed files with 61 additions and 59 deletions

View file

@ -81,7 +81,7 @@ static void NSISCALL outernotify(char num) {
} }
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT #ifdef NSIS_CONFIG_VISIBLE_SUPPORT
static BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
static int CALLBACK WINAPI BrowseCallbackProc( HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData); static int CALLBACK WINAPI BrowseCallbackProc( HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
#ifdef NSIS_CONFIG_LICENSEPAGE #ifdef NSIS_CONFIG_LICENSEPAGE
static BOOL CALLBACK LicenseProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); static BOOL CALLBACK LicenseProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
@ -405,8 +405,9 @@ int NSISCALL ui_doinstall(void)
static char str2[]="RichEdit20A"; static char str2[]="RichEdit20A";
if (!LoadLibrary(str1)) if (!LoadLibrary(str1))
{ {
str1[6]='3'; ((short*)str1)[3]=*(short*)"32";
str1[7]='2'; //str1[6]='3';
//str1[7]='2';
LoadLibrary(str1); LoadLibrary(str1);
} }
@ -463,7 +464,7 @@ static int CALLBACK WINAPI BrowseCallbackProc( HWND hwnd, UINT uMsg, LPARAM lPar
} }
static BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
static HICON hIcon; static HICON hIcon;
if (uMsg == WM_DESTROY && hIcon) { DeleteObject(hIcon); hIcon=0; } if (uMsg == WM_DESTROY && hIcon) { DeleteObject(hIcon); hIcon=0; }
@ -1138,73 +1139,73 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
if ((TVHT_ONITEMSTATEICON|TVHT_ONITEMLABEL|TVHT_ONITEMRIGHT|TVHT_ONITEM) & ht.flags) if ((TVHT_ONITEMSTATEICON|TVHT_ONITEMLABEL|TVHT_ONITEMRIGHT|TVHT_ONITEM) & ht.flags)
{ {
TVITEM hItem; TVITEM hItem;
hItem.hItem = ht.hItem; hItem.hItem = ht.hItem;
hItem.mask = TVIF_STATE|TVIF_PARAM; hItem.mask = TVIF_STATE|TVIF_PARAM;
TreeView_GetItem(hwndTree1, &hItem); TreeView_GetItem(hwndTree1, &hItem);
if (!(g_inst_section[hItem.lParam].default_state&DFS_RO)) if (!(g_inst_section[hItem.lParam].default_state&DFS_RO))
{
if ((hItem.state >> 12) == 2) // already checked
{ {
if ((hItem.state >> 12) == 2) // already checked g_inst_section[hItem.lParam].default_state&=~DFS_SET;
{ CheckTreeItem(hwndTree1,&hItem,0);
g_inst_section[hItem.lParam].default_state&=~DFS_SET; }
CheckTreeItem(hwndTree1,&hItem,0); else
} {
else g_inst_section[hItem.lParam].default_state|=DFS_SET;
{ CheckTreeItem(hwndTree1,&hItem,1);
g_inst_section[hItem.lParam].default_state|=DFS_SET; }
CheckTreeItem(hwndTree1,&hItem,1);
}
#if defined(NSIS_SUPPORT_CODECALLBACKS) && defined(NSIS_CONFIG_COMPONENTPAGE) #if defined(NSIS_SUPPORT_CODECALLBACKS) && defined(NSIS_CONFIG_COMPONENTPAGE)
{ {
extern HWND g_SectionHack; extern HWND g_SectionHack;
g_SectionHack=hwndDlg; g_SectionHack=hwndDlg;
ExecuteCodeSegment(g_inst_header->code_onSelChange,NULL); ExecuteCodeSegment(g_inst_header->code_onSelChange,NULL);
g_SectionHack=0; g_SectionHack=0;
} }
#endif//NSIS_SUPPORT_CODECALLBACKS && NSIS_CONFIG_COMPONENTPAGE #endif//NSIS_SUPPORT_CODECALLBACKS && NSIS_CONFIG_COMPONENTPAGE
{
int r,x;
// check to see which install type we are
for (r = 0; r < m_num_insttypes; r ++)
{ {
int r,x; HTREEITEM *ht=hTreeItems;
// check to see which install type we are section *t=g_inst_section;
for (r = 0; r < m_num_insttypes; r ++) x=num_sections;
while (x--)
{ {
HTREEITEM *ht=hTreeItems; char c=GetStringFromStringTab(t->name_ptr)[0];
section *t=g_inst_section; if (c && c!='-')
x=num_sections;
while (x--)
{ {
char c=GetStringFromStringTab(t->name_ptr)[0]; TV_ITEM hItem;
if (c && c!='-') hItem.hItem=*ht;
if (g_inst_header->no_custom_instmode_flag==1)
{ {
TV_ITEM hItem; int c=(t->default_state>>m_whichcfg)&1;
hItem.hItem=*ht; CheckTreeItem(hwndTree1, &hItem,c);
if (g_inst_header->no_custom_instmode_flag==1) }
{ else if (!(t->default_state&DFS_RO))
int c=(t->default_state>>m_whichcfg)&1; {
CheckTreeItem(hwndTree1, &hItem,c); hItem.mask=TVIF_STATE;
} TreeView_GetItem(hwndTree1,&hItem);
else if (!(t->default_state&DFS_RO)) if (!(t->default_state&(1<<r)) != !((hItem.state>>12)>1 )) break;
{
hItem.mask=TVIF_STATE;
TreeView_GetItem(hwndTree1,&hItem);
if (!(t->default_state&(1<<r)) != !((hItem.state>>12)>1 )) break;
}
} }
t++;
ht++;
} }
if (x < 0) break; t++;
ht++;
} }
if (x < 0) break;
}
if (!g_inst_header->no_custom_instmode_flag) if (!g_inst_header->no_custom_instmode_flag)
{ {
SendMessage(hwndCombo1,CB_SETCURSEL,r,0); SendMessage(hwndCombo1,CB_SETCURSEL,r,0);
m_whichcfg=r; m_whichcfg=r;
} }
} // end of typecheckshit } // end of typecheckshit
SendMessage(hwndDlg,WM_IN_UPDATEMSG,0,0); SendMessage(hwndDlg,WM_IN_UPDATEMSG,0,0);
} // not ro } // not ro
} // was valid click } // was valid click
} // was click or hack } // was click or hack
#ifdef NSIS_SUPPORT_CODECALLBACKS #ifdef NSIS_SUPPORT_CODECALLBACKS

View file

@ -226,6 +226,7 @@ static char _outbuffer[OBUFSIZE];
extern int m_length; extern int m_length;
extern int m_pos; extern int m_pos;
extern BOOL CALLBACK verProc(HWND, UINT, WPARAM, LPARAM); extern BOOL CALLBACK verProc(HWND, UINT, WPARAM, LPARAM);
extern BOOL CALLBACK DialogProc(HWND, UINT, WPARAM, LPARAM);
static int NSISCALL __ensuredata(int amount) static int NSISCALL __ensuredata(int amount)
{ {
HWND hwnd=NULL; HWND hwnd=NULL;
@ -259,7 +260,7 @@ static int NSISCALL __ensuredata(int amount)
m_pos=m_length-(amount-(dbd_size-dbd_pos)); m_pos=m_length-(amount-(dbd_size-dbd_pos));
while (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) DispatchMessage(&msg); while (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) DispatchMessage(&msg);
} }
else if (g_hwnd && GetTickCount() > verify_time) else if (GetWindowLong(g_hwnd,GWL_WNDPROC) != (long)DialogProc && GetTickCount() > verify_time)
hwnd=CreateDialogParam( hwnd=CreateDialogParam(
g_hInstance, g_hInstance,
MAKEINTRESOURCE(IDD_VERIFY), MAKEINTRESOURCE(IDD_VERIFY),