From 36265fb306f3729af02c029a23e43469f5b20a47 Mon Sep 17 00:00:00 2001 From: "ssu%netscape.com" Date: Thu, 8 Jul 2004 00:47:08 +0000 Subject: [PATCH] fixing bug 47762 - Installer switches focus to itself repeatedly. r=leaf, sr=dveditz, a=asa git-svn-id: svn://10.0.0.236/trunk@158882 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpinstall/packager/win_gre/install.it | 1 + .../packager/win_mfcembed/install.it | 1 + mozilla/xpinstall/packager/windows/install.it | 1 + .../xpinstall/wizard/windows/setup/dialogs.c | 281 +++++++++++++----- .../xpinstall/wizard/windows/setup/dialogs.h | 1 + .../xpinstall/wizard/windows/setup/extra.c | 58 ++-- .../xpinstall/wizard/windows/setup/extra.h | 2 +- .../xpinstall/wizard/windows/setup/ifuncns.c | 11 +- .../xpinstall/wizard/windows/setup/setup.c | 1 + .../xpinstall/wizard/windows/setup/setup.h | 3 + mozilla/xpinstall/wizard/windows/setup/xpi.c | 10 +- .../wizard/windows/setup/xpnetHook.cpp | 4 +- .../wizard/windows/setuprsc/setuprsc.rc | 1 + .../wizard/windows/uninstall/parser.c | 30 +- 14 files changed, 250 insertions(+), 155 deletions(-) diff --git a/mozilla/xpinstall/packager/win_gre/install.it b/mozilla/xpinstall/packager/win_gre/install.it index 25dc31a7c7c..a2d9f487e1c 100644 --- a/mozilla/xpinstall/packager/win_gre/install.it +++ b/mozilla/xpinstall/packager/win_gre/install.it @@ -84,6 +84,7 @@ ERROR_CREATE_DIRECTORY=Could not create folder: %sMake sure you have access to c ERROR_MESSAGE_TITLE=$ProductNameInternal$ Setup Error STR_FILE_NUMBER=File count: STR_FILENAME=Filename: +MSG_PLEASE_WAIT=Please wait... MSG_SMARTUPDATE_START=Preparing Install, please wait... MSG_CONFIGURING=Configuring %s, please wait... ERROR_XPI_INSTALL=Error occurred during installation diff --git a/mozilla/xpinstall/packager/win_mfcembed/install.it b/mozilla/xpinstall/packager/win_mfcembed/install.it index 25dc31a7c7c..a2d9f487e1c 100644 --- a/mozilla/xpinstall/packager/win_mfcembed/install.it +++ b/mozilla/xpinstall/packager/win_mfcembed/install.it @@ -84,6 +84,7 @@ ERROR_CREATE_DIRECTORY=Could not create folder: %sMake sure you have access to c ERROR_MESSAGE_TITLE=$ProductNameInternal$ Setup Error STR_FILE_NUMBER=File count: STR_FILENAME=Filename: +MSG_PLEASE_WAIT=Please wait... MSG_SMARTUPDATE_START=Preparing Install, please wait... MSG_CONFIGURING=Configuring %s, please wait... ERROR_XPI_INSTALL=Error occurred during installation diff --git a/mozilla/xpinstall/packager/windows/install.it b/mozilla/xpinstall/packager/windows/install.it index 25dc31a7c7c..a2d9f487e1c 100644 --- a/mozilla/xpinstall/packager/windows/install.it +++ b/mozilla/xpinstall/packager/windows/install.it @@ -84,6 +84,7 @@ ERROR_CREATE_DIRECTORY=Could not create folder: %sMake sure you have access to c ERROR_MESSAGE_TITLE=$ProductNameInternal$ Setup Error STR_FILE_NUMBER=File count: STR_FILENAME=Filename: +MSG_PLEASE_WAIT=Please wait... MSG_SMARTUPDATE_START=Preparing Install, please wait... MSG_CONFIGURING=Configuring %s, please wait... ERROR_XPI_INSTALL=Error occurred during installation diff --git a/mozilla/xpinstall/wizard/windows/setup/dialogs.c b/mozilla/xpinstall/wizard/windows/setup/dialogs.c index 09248ac85cb..0eed1f8d5ff 100644 --- a/mozilla/xpinstall/wizard/windows/setup/dialogs.c +++ b/mozilla/xpinstall/wizard/windows/setup/dialogs.c @@ -92,6 +92,15 @@ const int InstallProgressDlgItemList[] = {IDC_STATUS0, * list, we shouldn't use it. */ +void ClosePreviousDialog() +{ + if(!sgProduct.lastDialog) + return; + + DestroyWindow(sgProduct.lastDialog); + sgProduct.lastDialog = NULL; +} + BOOL AskCancelDlg(HWND hDlg) { char szDlgQuitTitle[MAX_BUF]; @@ -117,7 +126,6 @@ BOOL AskCancelDlg(HWND hDlg) GetPrivateProfileString("Strings", "Message Cancel Setup AUTO mode", "", szMsg, sizeof(szMsg), szFileIniConfig); ShowMessage(szMsg, TRUE); Delay(5); - ShowMessage(szMsg, FALSE); bRv = TRUE; } @@ -204,7 +212,8 @@ void RepositionWindow(HWND aHwndDlg, DWORD aBannerImage) int iLeft, iTop; DWORD width = -1; DWORD height = -1; - DWORD windowFlags = SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE; + DWORD windowFlags = SWP_NOSIZE | SWP_NOACTIVATE; + HWND insertAfterHwnd; GetWindowRect(aHwndDlg, &rect); if(aBannerImage && !gShowBannerImage) @@ -217,7 +226,7 @@ void RepositionWindow(HWND aHwndDlg, DWORD aBannerImage) ShowWindow(hwndBanner, SW_HIDE); width = rect.right; height = rect.bottom - rLogo.bottom + rLogo.top; - windowFlags = SWP_NOZORDER | SWP_NOACTIVATE; + windowFlags = SWP_NOACTIVATE; /* aBannerImage indicates which dialog we need to move it's dlg items * up to fit the resized window. @@ -237,9 +246,21 @@ void RepositionWindow(HWND aHwndDlg, DWORD aBannerImage) } } + if(gSystemInfo.lastWindowIsTopWindow) + insertAfterHwnd = HWND_TOP; + else + insertAfterHwnd = HWND_BOTTOM; + iLeft = (gSystemInfo.lastWindowPosCenterX - ((rect.right - rect.left) / 2)); iTop = (gSystemInfo.lastWindowPosCenterY - ((rect.bottom - rect.top) / 2)); - SetWindowPos(aHwndDlg, NULL, iLeft, iTop, width, height, windowFlags); + SetWindowPos(aHwndDlg, insertAfterHwnd, iLeft, iTop, width, height, windowFlags); + + if(gSystemInfo.lastWindowMinimized) + ShowWindow(aHwndDlg, SW_SHOWMINNOACTIVE); + else if(!gSystemInfo.lastWindowIsTopWindow) + ShowWindow(aHwndDlg, SW_SHOWNOACTIVATE); + else + ShowWindow(aHwndDlg, SW_SHOW); } /* Function: SaveWindowPosition() @@ -251,13 +272,37 @@ void RepositionWindow(HWND aHwndDlg, DWORD aBannerImage) */ void SaveWindowPosition(HWND aDlg) { - RECT rectDlg; + WINDOWPLACEMENT wndPlacement; + HWND hwndForegroundWindow; + HWND hwndTopWindow; + HWND hwndParent = NULL; + HWND hwndWindow = NULL; - if(GetWindowRect(aDlg, &rectDlg)) + if(GetWindowPlacement(aDlg, &wndPlacement)) { - gSystemInfo.lastWindowPosCenterX = ((rectDlg.right - rectDlg.left) / 2) + rectDlg.left; - gSystemInfo.lastWindowPosCenterY = ((rectDlg.bottom - rectDlg.top) / 2) + rectDlg.top; + gSystemInfo.lastWindowPosCenterX = ((wndPlacement.rcNormalPosition.right - wndPlacement.rcNormalPosition.left) / 2) + wndPlacement.rcNormalPosition.left; + gSystemInfo.lastWindowPosCenterY = ((wndPlacement.rcNormalPosition.bottom - wndPlacement.rcNormalPosition.top) / 2) + wndPlacement.rcNormalPosition.top; + gSystemInfo.lastWindowMinimized = (wndPlacement.showCmd & SW_MINIMIZE)?TRUE:FALSE; } + + hwndForegroundWindow = GetForegroundWindow(); + hwndTopWindow = GetTopWindow(NULL); + hwndWindow = NULL; + hwndParent = GetParent(aDlg); + while(hwndParent != NULL) + { + hwndWindow = hwndParent; + hwndParent = GetParent(hwndWindow); + } + + if(hwndParent == aDlg) + gSystemInfo.lastWindowIsTopWindow = TRUE; + else if((hwndParent == NULL) && (hwndWindow == aDlg)) + gSystemInfo.lastWindowIsTopWindow = TRUE; + else if(hwndForegroundWindow == aDlg) + gSystemInfo.lastWindowIsTopWindow = TRUE; + else + gSystemInfo.lastWindowIsTopWindow = FALSE; } LRESULT CALLBACK DlgProcWelcome(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam) @@ -284,6 +329,7 @@ LRESULT CALLBACK DlgProcWelcome(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam) SendDlgItemMessage (hDlg, IDC_STATIC2, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); SendDlgItemMessage (hDlg, IDWIZNEXT, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); SendDlgItemMessage (hDlg, IDCANCEL, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); + ClosePreviousDialog(); break; case WM_COMMAND: @@ -291,7 +337,7 @@ LRESULT CALLBACK DlgProcWelcome(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam) { case IDWIZNEXT: SaveWindowPosition(hDlg); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(NEXT_DLG); break; @@ -357,6 +403,7 @@ LRESULT CALLBACK DlgProcLicense(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam) SendDlgItemMessage (hDlg, IDWIZBACK, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); SendDlgItemMessage (hDlg, IDWIZNEXT, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); SendDlgItemMessage (hDlg, IDCANCEL, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); + ClosePreviousDialog(); break; case WM_COMMAND: @@ -364,13 +411,13 @@ LRESULT CALLBACK DlgProcLicense(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam) { case IDWIZNEXT: SaveWindowPosition(hDlg); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(NEXT_DLG); break; case IDWIZBACK: SaveWindowPosition(hDlg); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(PREV_DLG); break; @@ -809,6 +856,7 @@ LRESULT CALLBACK DlgProcSetupType(HWND hDlg, UINT msg, WPARAM wParam, LONG lPara else EnableWindow(GetDlgItem(hDlg, IDC_BUTTON_BROWSE), TRUE); + ClosePreviousDialog(); break; case WM_COMMAND: @@ -912,7 +960,7 @@ LRESULT CALLBACK DlgProcSetupType(HWND hDlg, UINT msg, WPARAM wParam, LONG lPara dwTempSetupType = dwSetupType; SiCNodeSetItemsSelected(dwSetupType); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(NEXT_DLG); break; @@ -920,7 +968,7 @@ LRESULT CALLBACK DlgProcSetupType(HWND hDlg, UINT msg, WPARAM wParam, LONG lPara SaveWindowPosition(hDlg); dwTempSetupType = dwSetupType; lstrcpy(szTempSetupPath, sgProduct.szPath); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(PREV_DLG); break; @@ -974,6 +1022,7 @@ LRESULT CALLBACK DlgProcUpgrade(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam) SendDlgItemMessage (hDlg, IDCONTINUE, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); SendDlgItemMessage (hDlg, IDSKIP, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); SendDlgItemMessage (hDlg, IDWIZBACK, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); + ClosePreviousDialog(); break; case WM_COMMAND: @@ -995,7 +1044,7 @@ LRESULT CALLBACK DlgProcUpgrade(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam) SiCNodeSetItemsSelected(dwSetupType); SaveWindowPosition(hDlg); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(NEXT_DLG); break; @@ -1003,13 +1052,13 @@ LRESULT CALLBACK DlgProcUpgrade(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam) sgProduct.doCleanupOnUpgrade = FALSE; SiCNodeSetItemsSelected(dwSetupType); SaveWindowPosition(hDlg); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(NEXT_DLG); break; case IDWIZBACK: SaveWindowPosition(hDlg); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(PREV_DLG); break; @@ -1382,6 +1431,7 @@ LRESULT CALLBACK DlgProcSelectComponents(HWND hDlg, UINT msg, WPARAM wParam, LON lstrcat(szBuf, " KB"); SetDlgItemText(hDlg, IDC_DOWNLOAD_SIZE, szBuf); + ClosePreviousDialog(); break; case WM_COMMAND: @@ -1395,13 +1445,13 @@ LRESULT CALLBACK DlgProcSelectComponents(HWND hDlg, UINT msg, WPARAM wParam, LON case IDWIZNEXT: SaveWindowPosition(hDlg); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(NEXT_DLG); break; case IDWIZBACK: SaveWindowPosition(hDlg); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(PREV_DLG); break; @@ -1522,6 +1572,7 @@ LRESULT CALLBACK DlgProcSelectAdditionalComponents(HWND hDlg, UINT msg, WPARAM w lstrcat(szBuf, " KB"); SetDlgItemText(hDlg, IDC_DOWNLOAD_SIZE, szBuf); + ClosePreviousDialog(); break; case WM_COMMAND: @@ -1535,13 +1586,13 @@ LRESULT CALLBACK DlgProcSelectAdditionalComponents(HWND hDlg, UINT msg, WPARAM w case IDWIZNEXT: SaveWindowPosition(hDlg); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(NEXT_DLG); break; case IDWIZBACK: SaveWindowPosition(hDlg); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(PREV_DLG); break; @@ -1628,6 +1679,7 @@ LRESULT CALLBACK DlgProcWindowsIntegration(HWND hDlg, UINT msg, WPARAM wParam, L SendDlgItemMessage (hDlg, IDC_CHECK2, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); SendDlgItemMessage (hDlg, IDC_CHECK3, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); SendDlgItemMessage (hDlg, IDC_MESSAGE1, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); + ClosePreviousDialog(); break; case WM_COMMAND: @@ -1671,13 +1723,13 @@ LRESULT CALLBACK DlgProcWindowsIntegration(HWND hDlg, UINT msg, WPARAM wParam, L diWindowsIntegration.wiCB3.bCheckBoxState = FALSE; } - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(NEXT_DLG); break; case IDWIZBACK: SaveWindowPosition(hDlg); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(PREV_DLG); break; @@ -1740,6 +1792,7 @@ LRESULT CALLBACK DlgProcProgramFolder(HWND hDlg, UINT msg, WPARAM wParam, LONG l SendDlgItemMessage (hDlg, IDC_MESSAGE0, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); SendDlgItemMessage (hDlg, IDC_EDIT_PROGRAM_FOLDER, WM_SETFONT, (WPARAM)sgInstallGui.systemFont, 0L); SendDlgItemMessage (hDlg, IDC_LIST, WM_SETFONT, (WPARAM)sgInstallGui.systemFont, 0L); + ClosePreviousDialog(); break; case WM_COMMAND: @@ -1758,13 +1811,13 @@ LRESULT CALLBACK DlgProcProgramFolder(HWND hDlg, UINT msg, WPARAM wParam, LONG l } lstrcpy(sgProduct.szProgramFolderName, szBuf); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(NEXT_DLG); break; case IDWIZBACK: SaveWindowPosition(hDlg); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(PREV_DLG); break; @@ -1865,7 +1918,7 @@ LRESULT CALLBACK DlgProcAdvancedSettings(HWND hDlg, UINT msg, WPARAM wParam, LON ShowWindow(GetDlgItem(hDlg, IDC_USE_FTP), SW_HIDE); ShowWindow(GetDlgItem(hDlg, IDC_USE_HTTP), SW_HIDE); } - + ClosePreviousDialog(); break; case WM_COMMAND: @@ -1880,14 +1933,14 @@ LRESULT CALLBACK DlgProcAdvancedSettings(HWND hDlg, UINT msg, WPARAM wParam, LON GetDlgItemText(hDlg, IDC_EDIT_PROXY_PASSWD, diAdvancedSettings.szProxyPasswd, MAX_BUF); SaveDownloadProtocolOption(hDlg); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(NEXT_DLG); break; case IDWIZBACK: case IDCANCEL: SaveWindowPosition(hDlg); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(PREV_DLG); break; @@ -2016,6 +2069,7 @@ LRESULT CALLBACK DlgProcAdditionalOptions(HWND hDlg, UINT msg, WPARAM wParam, LO else CheckDlgButton(hDlg, IDC_CHECK_RECAPTURE_HOMEPAGE, BST_UNCHECKED); + ClosePreviousDialog(); break; case WM_COMMAND: @@ -2024,21 +2078,21 @@ LRESULT CALLBACK DlgProcAdditionalOptions(HWND hDlg, UINT msg, WPARAM wParam, LO case IDWIZNEXT: SaveWindowPosition(hDlg); SaveAdditionalOptions(hDlg, hwndCBSiteSelector); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(NEXT_DLG); break; case IDWIZBACK: SaveWindowPosition(hDlg); SaveAdditionalOptions(hDlg, hwndCBSiteSelector); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(PREV_DLG); break; case IDC_BUTTON_ADDITIONAL_SETTINGS: SaveWindowPosition(hDlg); SaveAdditionalOptions(hDlg, hwndCBSiteSelector); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(OTHER_DLG_1); break; @@ -2368,6 +2422,7 @@ LRESULT CALLBACK DlgProcQuickLaunch(HWND hDlg, UINT msg, WPARAM wParam, LONG lPa else CheckDlgButton(hDlg, IDC_CHECK_TURBO_MODE, BST_UNCHECKED); + ClosePreviousDialog(); break; case WM_COMMAND: @@ -2383,7 +2438,7 @@ LRESULT CALLBACK DlgProcQuickLaunch(HWND hDlg, UINT msg, WPARAM wParam, LONG lPa diQuickLaunch.bTurboMode = FALSE; } - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(NEXT_DLG); break; @@ -2396,7 +2451,7 @@ LRESULT CALLBACK DlgProcQuickLaunch(HWND hDlg, UINT msg, WPARAM wParam, LONG lPa else { diQuickLaunch.bTurboMode = FALSE; } - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(PREV_DLG); break; @@ -2451,7 +2506,7 @@ LRESULT CALLBACK DlgProcStartInstall(HWND hDlg, UINT msg, WPARAM wParam, LONG lP SetDlgItemText(hDlg, IDC_CURRENT_SETTINGS, szMessage); FreeMemory(&szMessage); } - + ClosePreviousDialog(); break; case WM_COMMAND: @@ -2459,13 +2514,13 @@ LRESULT CALLBACK DlgProcStartInstall(HWND hDlg, UINT msg, WPARAM wParam, LONG lP { case IDWIZNEXT: SaveWindowPosition(hDlg); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(NEXT_DLG); break; case IDWIZBACK: SaveWindowPosition(hDlg); - DestroyWindow(hDlg); + sgProduct.lastDialog = hDlg; DlgSequence(PREV_DLG); break; @@ -2554,6 +2609,56 @@ LRESULT CALLBACK DlgProcReboot(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam) return(0); } +void ResizeAndSetString(HWND aDlg, LPARAM lParam) +{ + HDC hdcSTMessage; + RECT rDlg; + SIZE sizeString; + LOGFONT logFont; + HFONT hfontTmp; + HFONT hfontOld; + LPSTR string = (LPSTR)lParam; + HWND hSTMessage; + int width; + int height; + + if(!aDlg || !string || (*string == 0)) + return; + + hSTMessage = GetDlgItem(aDlg, IDC_MESSAGE); /* handle to the Static Text message window */ + hdcSTMessage = GetWindowDC(hSTMessage); + SystemParametersInfo(SPI_GETICONTITLELOGFONT, + sizeof(logFont), + (PVOID)&logFont, + 0); + hfontTmp = CreateFontIndirect(&logFont); + if(hfontTmp) + hfontOld = SelectObject(hdcSTMessage, hfontTmp); + + GetTextExtentPoint32(hdcSTMessage, string, lstrlen(string), &sizeString); + SelectObject(hdcSTMessage, hfontOld); + ReleaseDC(hSTMessage, hdcSTMessage); + DeleteObject(hfontTmp); + width = sizeString.cx + 55>150?sizeString.cx + 55:150; + height = sizeString.cy + 50; + SetWindowPos(aDlg, aDlg, + (gSystemInfo.lastWindowPosCenterX)-(width/2), + (gSystemInfo.lastWindowPosCenterY)-(height/2), + width, + height, + SWP_NOACTIVATE|SWP_NOZORDER|SWP_SHOWWINDOW); + if(GetClientRect(aDlg, &rDlg)) + SetWindowPos(hSTMessage, + hSTMessage, + rDlg.left, + rDlg.top, + rDlg.right, + rDlg.bottom, + SWP_NOACTIVATE|SWP_NOZORDER|SWP_SHOWWINDOW); + SetDlgItemText(aDlg, IDC_MESSAGE, string); + SaveWindowPosition(aDlg); +} + LRESULT CALLBACK DlgProcMessage(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam) { RECT rDlg; @@ -2565,6 +2670,7 @@ LRESULT CALLBACK DlgProcMessage(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam) HFONT hfontOld; char szBuf[MAX_BUF]; char szBuf2[MAX_BUF]; + BOOL wasMinimized = FALSE; ZeroMemory(szBuf, sizeof(szBuf)); ZeroMemory(szBuf2, sizeof(szBuf2)); @@ -2572,6 +2678,7 @@ LRESULT CALLBACK DlgProcMessage(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam) switch(msg) { case WM_INITDIALOG: + DisableSystemMenuItems(hDlg, TRUE); if(GetPrivateProfileString("Messages", "STR_MESSAGEBOX_TITLE", "", szBuf2, sizeof(szBuf2), szFileIniInstall)) { if((sgProduct.szProductName != NULL) && (*sgProduct.szProductName != '\0')) @@ -2582,48 +2689,33 @@ LRESULT CALLBACK DlgProcMessage(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam) else if((sgProduct.szProductName != NULL) && (*sgProduct.szProductName != '\0')) lstrcpy(szBuf, sgProduct.szProductName); + SendDlgItemMessage(hDlg, IDC_MESSAGE, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); SetWindowText(hDlg, szBuf); RepositionWindow(hDlg, NO_BANNER_IMAGE); break; + case WM_SIZE: + switch(wParam) + { + case SIZE_MINIMIZED: + wasMinimized = TRUE; + break; + + case SIZE_RESTORED: + if(wasMinimized) + { + wasMinimized = FALSE; + ResizeAndSetString(hDlg, lParam); + } + break; + } + return(FALSE); + case WM_COMMAND: switch(LOWORD(wParam)) { case IDC_MESSAGE: - SaveWindowPosition(hDlg); - hdcSTMessage = GetWindowDC(hSTMessage); - - SystemParametersInfo(SPI_GETICONTITLELOGFONT, - sizeof(logFont), - (PVOID)&logFont, - 0); - hfontTmp = CreateFontIndirect(&logFont); - - if(hfontTmp) - hfontOld = SelectObject(hdcSTMessage, hfontTmp); - - GetTextExtentPoint32(hdcSTMessage, (LPSTR)lParam, lstrlen((LPSTR)lParam), &sizeString); - SelectObject(hdcSTMessage, hfontOld); - DeleteObject(hfontTmp); - ReleaseDC(hSTMessage, hdcSTMessage); - - SetWindowPos(hDlg, NULL, - (gSystemInfo.lastWindowPosCenterX)-((sizeString.cx + 55)/2), - (gSystemInfo.lastWindowPosCenterY)-((sizeString.cy + 50)/2), - sizeString.cx + 55, - sizeString.cy + 50, - SWP_SHOWWINDOW|SWP_NOZORDER); - - if(GetClientRect(hDlg, &rDlg)) - SetWindowPos(hSTMessage, - HWND_TOP, - rDlg.left, - rDlg.top, - rDlg.right, - rDlg.bottom, - SWP_SHOWWINDOW|SWP_NOZORDER); - - SetDlgItemText(hDlg, IDC_MESSAGE, (LPSTR)lParam); + ResizeAndSetString(hDlg, lParam); break; } break; @@ -2644,24 +2736,46 @@ void ProcessWindowsMessages() void ShowMessage(LPSTR szMessage, BOOL bShow) { - if(sgProduct.mode != SILENT) + if(sgProduct.mode == SILENT) + return; + + if(bShow) { - if(bShow && szMessage) + if(!szMessage || (*szMessage == '\0')) + return; + + if(!hDlgMessage) { char szBuf[MAX_BUF]; - + ZeroMemory(szBuf, sizeof(szBuf)); GetPrivateProfileString("Messages", "MB_MESSAGE_STR", "", szBuf, sizeof(szBuf), szFileIniInstall); hDlgMessage = InstantiateDialog(hWndMain, DLG_MESSAGE, szBuf, DlgProcMessage); - SendMessage(hDlgMessage, WM_COMMAND, IDC_MESSAGE, (LPARAM)szMessage); - SendDlgItemMessage (hDlgMessage, IDC_MESSAGE, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); + } + + if(!IsWindowVisible(hDlgMessage)) + { + DWORD cmdShow = 0x00000000; + + if(gSystemInfo.lastWindowMinimized) + cmdShow = SW_SHOWMINNOACTIVE; + + if(gSystemInfo.lastWindowIsTopWindow) + cmdShow = SW_SHOWNORMAL; + + RepositionWindow(hDlgMessage, NO_BANNER_IMAGE); + ShowWindow(hDlgMessage, cmdShow); } else - { SaveWindowPosition(hDlgMessage); - DestroyWindow(hDlgMessage); - hDlgMessage = NULL; - } + + SendMessage(hDlgMessage, WM_COMMAND, IDC_MESSAGE, (LPARAM)szMessage); + } + else if(hDlgMessage && (IsWindowVisible(hDlgMessage) || gSystemInfo.lastWindowMinimized)) + { + SaveWindowPosition(hDlgMessage); + DestroyWindow(hDlgMessage); + hDlgMessage = NULL; } } @@ -3005,10 +3119,15 @@ void DlgSequence(int iDirection) void CommitInstall(void) { HRESULT hrErr; + char msgPleaseWait[MAX_BUF]; char szDestPath[MAX_BUF]; char szInstallLogFile[MAX_BUF]; long RetrieveResults; + GetPrivateProfileString("Messages", "MSG_PLEASE_WAIT", "", msgPleaseWait, sizeof(msgPleaseWait), szFileIniInstall); + ShowMessage(msgPleaseWait, TRUE); + ClosePreviousDialog(); + LogISShared(); LogISDestinationPath(); LogISSetupType(); @@ -3113,7 +3232,6 @@ void CommitInstall(void) bSDUserCanceled = TRUE; CleanupXpcomFile(); PostQuitMessage(0); - return; } @@ -3133,7 +3251,7 @@ void CommitInstall(void) bSDUserCanceled = TRUE; CleanupXpcomFile(); PostQuitMessage(0); - + ShowMessage(NULL, FALSE); return; } @@ -3152,6 +3270,7 @@ void CommitInstall(void) else hrErr = WIZ_OK; + ShowMessage(msgPleaseWait, TRUE); if((hrErr == WIZ_OK) || (hrErr == 999)) { if(sgProduct.bInstallFiles) @@ -3186,6 +3305,7 @@ void CommitInstall(void) } CleanupXpcomFile(); + ShowMessage(NULL, FALSE); if(NeedReboot()) { LogExitStatus("Reboot"); @@ -3210,5 +3330,6 @@ void CommitInstall(void) CleanupArgsRegistry(); PostQuitMessage(0); } + ShowMessage(NULL, FALSE); gbProcessingXpnstallFiles = FALSE; } diff --git a/mozilla/xpinstall/wizard/windows/setup/dialogs.h b/mozilla/xpinstall/wizard/windows/setup/dialogs.h index c16389dc98c..910440b5894 100644 --- a/mozilla/xpinstall/wizard/windows/setup/dialogs.h +++ b/mozilla/xpinstall/wizard/windows/setup/dialogs.h @@ -81,6 +81,7 @@ void DisableSystemMenuItems(HWND hWnd, BOOL bDisableClose); void CommitInstall(void); void RepositionWindow(HWND aHwndDlg, DWORD aBannerImage); void SaveWindowPosition(HWND aDlg); +void ClosePreviousDialog(void); #endif /* _DIALOGS_H_ */ diff --git a/mozilla/xpinstall/wizard/windows/setup/extra.c b/mozilla/xpinstall/wizard/windows/setup/extra.c index 4052bad801f..934c088ca83 100644 --- a/mozilla/xpinstall/wizard/windows/setup/extra.c +++ b/mozilla/xpinstall/wizard/windows/setup/extra.c @@ -158,8 +158,10 @@ BOOL InitInstance(HINSTANCE hInstance, DWORD dwCmdShow) gSystemInfo.dwScreenX = GetSystemMetrics(SM_CXSCREEN); gSystemInfo.dwScreenY = GetSystemMetrics(SM_CYSCREEN); - gSystemInfo.lastWindowPosCenterX = gSystemInfo.dwScreenX / 2; - gSystemInfo.lastWindowPosCenterY = gSystemInfo.dwScreenY / 2; + gSystemInfo.lastWindowPosCenterX = gSystemInfo.dwScreenX / 2; + gSystemInfo.lastWindowPosCenterY = gSystemInfo.dwScreenY / 2; + gSystemInfo.lastWindowMinimized = FALSE; + gSystemInfo.lastWindowIsTopWindow = TRUE; hInst = hInstance; @@ -204,13 +206,14 @@ void PrintError(LPSTR szMsg, DWORD dwErrorCodeSH) if((sgProduct.mode != SILENT) && (sgProduct.mode != AUTO)) { + ShowMessage(NULL, FALSE); MessageBox(hWndMain, szErrorString, NULL, MB_ICONEXCLAMATION); } else if(sgProduct.mode == AUTO) { ShowMessage(szErrorString, TRUE); Delay(5); - ShowMessage(szErrorString, FALSE); + ShowMessage(NULL, FALSE); } } @@ -296,7 +299,12 @@ HRESULT NS_LoadString(HANDLE hInstance, DWORD dwID, LPSTR szStringBuf, DWORD dwS void Delay(DWORD dwSeconds) { - SleepEx(dwSeconds * 1000, FALSE); + DWORD i; + for(i = 0; i < dwSeconds * 10; i++) + { + SleepEx(100, FALSE); + ProcessWindowsMessages(); + } } BOOL VerifyRestrictedAccess(void) @@ -1765,7 +1773,6 @@ int CRCCheckDownloadedArchives(char *szCorruptedArchiveList, ++dwIndex0; siCObject = SiCNodeGetObject(dwIndex0, TRUE, AC_ALL); } - ShowMessage(szMsgCRCCheck, FALSE); return(iResult); } @@ -2587,10 +2594,6 @@ HRESULT CleanupOrphanedGREs() if(greIDListToClean) GlobalFree(greIDListToClean); - // Hide message that orphaned GREs are being cleaned up - if(*sgProduct.greCleanupOrphansMessage != '\0'); - ShowMessage(sgProduct.greCleanupOrphansMessage, FALSE); - return(rv); } @@ -2657,11 +2660,7 @@ void LaunchOneComponent(siC *siCObject, greInfo *aGre) LogISLaunchAppsComponentUncompress(siCObject->szDescriptionShort, dwErr); if(dwErr != FO_SUCCESS) - { - if(*szMessageString != '\0') - ShowMessage(szMessageString, FALSE); return; - } } if(aGre) @@ -2675,9 +2674,6 @@ void LaunchOneComponent(siC *siCObject, greInfo *aGre) if(siCObject->dwAttributes & SIC_UNCOMPRESS) FileDelete(szSpawnFile); - - if(*szMessageString != '\0') - ShowMessage(szMessageString, FALSE); } } } @@ -2706,8 +2702,6 @@ void LaunchExistingGreInstaller(greInfo *aGre) UpdateGreInstallerCmdLine(NULL, szParameterBuf, sizeof(szParameterBuf), FOR_EXISTING_GRE); LogISLaunchAppsComponent(siCObject->szDescriptionShort); WinSpawn(aGre->installerAppPath, szParameterBuf, szTempDir, SW_SHOWNORMAL, WS_WAIT); - if(*szMessageString != '\0') - ShowMessage(szMessageString, FALSE); } HRESULT LaunchApps() @@ -3220,9 +3214,6 @@ HRESULT ProcessXpinstallEngine() if((WIZ_OK == rv) && (siCFXpcomFile.bStatus == STATUS_ENABLED)) rv = ProcessXpcomFile(); - if(*siCFXpcomFile.szMessage != '\0') - ShowMessage(siCFXpcomFile.szMessage, FALSE); - return(rv); } @@ -5004,13 +4995,13 @@ HRESULT ErrorMsgDiskSpace(ULONGLONG ullDSAvailable, ULONGLONG ullDSRequired, LPS if((sgProduct.mode != SILENT) && (sgProduct.mode != AUTO)) { + ShowMessage(NULL, FALSE); return(MessageBox(hWndMain, szBufMsg, szDlgDiskSpaceCheckTitle, dwDlgType | MB_ICONEXCLAMATION | MB_DEFBUTTON2 | MB_APPLMODAL | MB_SETFOREGROUND)); } else if(sgProduct.mode == AUTO) { ShowMessage(szBufMsg, TRUE); Delay(5); - ShowMessage(szBufMsg, FALSE); exit(1); } @@ -6308,6 +6299,7 @@ void PrintUsage(void) _snprintf(szUsageMsg, sizeof(szUsageMsg), szBuf, szProcessFilename); szUsageMsg[sizeof(szUsageMsg) - 1] = '\0'; GetPrivateProfileString("Messages", "DLG_USAGE_TITLE", "", strUsage, sizeof(strUsage), szFileIniInstall); + ShowMessage(NULL, FALSE); MessageBox(hWndMain, szUsageMsg, strUsage, MB_ICONEXCLAMATION); } } @@ -6370,7 +6362,7 @@ DWORD ParseForStartupOptions(LPSTR aCmdLine) return(WIZ_OK); } -DWORD ParseCommandLine(LPSTR aMessageToClose, LPSTR lpszCmdLine) +DWORD ParseCommandLine(LPSTR lpszCmdLine) { char szArgVBuf[MAX_BUF]; int i; @@ -6394,7 +6386,7 @@ DWORD ParseCommandLine(LPSTR aMessageToClose, LPSTR lpszCmdLine) if(!lstrcmpi(szArgVBuf, "-h") || !lstrcmpi(szArgVBuf, "/h")) { - ShowMessage(aMessageToClose, FALSE); + ShowMessage(NULL, FALSE); PrintUsage(); return(WIZ_ERROR_UNDEFINED); } @@ -6646,6 +6638,7 @@ HRESULT ShowMessageAndQuitProcess(HWND aHwndFW, char *aMsgQuitProcess, char *aMs { char msgTitleStr[MAX_BUF]; GetPrivateProfileString("Messages", "MB_ATTENTION_STR", "", msgTitleStr, sizeof(msgTitleStr), szFileIniInstall); + ShowMessage(NULL, TRUE); MessageBox(hWndMain, aMsgQuitProcess, msgTitleStr, MB_ICONEXCLAMATION | MB_SETFOREGROUND); break; } @@ -6656,7 +6649,6 @@ HRESULT ShowMessageAndQuitProcess(HWND aHwndFW, char *aMsgQuitProcess, char *aMs * all the windows associated with the process */ ShowMessage(aMsgQuitProcess, TRUE); Delay(5); - ShowMessage(aMsgQuitProcess, FALSE); break; } @@ -6758,6 +6750,7 @@ HRESULT CheckInstances() switch(sgProduct.mode) { case NORMAL: + ShowMessage(NULL, FALSE); MessageBox(hWndMain, buf, msgTitleStr, MB_ICONEXCLAMATION | MB_SETFOREGROUND); break; @@ -6766,7 +6759,6 @@ HRESULT CheckInstances() * all the windows associated with the process */ ShowMessage(buf, TRUE); Delay(5); - ShowMessage(buf, FALSE); break; default: @@ -6981,7 +6973,6 @@ int CRCCheckArchivesStartup(char *szCorruptedArchiveList, DWORD dwCorruptedArchi ++dwIndex0; siCObject = SiCNodeGetObject(dwIndex0, TRUE, AC_ALL); } - ShowMessage(szMsgCRCCheck, FALSE); return(iResult); } @@ -7022,7 +7013,6 @@ int StartupCheckArchives(void) GetPrivateProfileString("Strings", "Error Corrupted Archives Detected AUTO mode", "", szBuf, sizeof(szBuf), szFileIniConfig); ShowMessage(szBuf, TRUE); Delay(5); - ShowMessage(szBuf, FALSE); break; } @@ -7232,7 +7222,7 @@ HRESULT ParseConfigIni(LPSTR lpszCmdLine) if(lstrcmpi(szBuf, "FALSE") == 0) gShowBannerImage = FALSE; - iRv = ParseCommandLine(szMsgInitSetup, lpszCmdLine); + iRv = ParseCommandLine(lpszCmdLine); if(iRv) return(iRv); @@ -7259,11 +7249,9 @@ HRESULT ParseConfigIni(LPSTR lpszCmdLine) break; case AUTO: - ShowMessage(szMsgInitSetup, FALSE); GetPrivateProfileString("Strings", "Message AUTO Restricted Access", "", szBuf, sizeof(szBuf), szFileIniConfig); ShowMessage(szBuf, TRUE); Delay(5); - ShowMessage(szBuf, FALSE); iRvMB = IDNO; break; @@ -7611,7 +7599,6 @@ HRESULT ParseConfigIni(LPSTR lpszCmdLine) LogISProductInfo(); LogMSProductInfo(); CleanupXpcomFile(); - ShowMessage(szMsgInitSetup, FALSE); /* check the windows registry to see if a previous instance of setup finished downloading * all the required archives. */ @@ -9022,6 +9009,12 @@ void DeInitialize() if(gErrorMessageStream.bEnabled && gErrorMessageStream.bSendMessage) SendErrorMessage(); + if(hDlgMessage) + { + DestroyWindow(hDlgMessage); + hDlgMessage = NULL; + } + DeInitSiComponents(&siComponents); DeInitGre(&gGre); DeInitSXpcomFile(); @@ -9140,6 +9133,7 @@ void SaveInstallerFiles() i = 0; while(TRUE) { + ProcessWindowsMessages(); if(*SetupFileList[i] == '\0') break; diff --git a/mozilla/xpinstall/wizard/windows/setup/extra.h b/mozilla/xpinstall/wizard/windows/setup/extra.h index 02f2798583a..99cd089f45a 100644 --- a/mozilla/xpinstall/wizard/windows/setup/extra.h +++ b/mozilla/xpinstall/wizard/windows/setup/extra.h @@ -184,7 +184,7 @@ LPSTR GetArgV(LPSTR lpszCommandLine, int iIndex, LPSTR lpszDest, int iDestSize); -DWORD ParseCommandLine(LPSTR aMessageToClose, LPSTR lpszCmdLine); +DWORD ParseCommandLine(LPSTR lpszCmdLine); DWORD ParseForStartupOptions(LPSTR aCmdLine); void SetSetupRunMode(LPSTR szMode); void Delay(DWORD dwSeconds); diff --git a/mozilla/xpinstall/wizard/windows/setup/ifuncns.c b/mozilla/xpinstall/wizard/windows/setup/ifuncns.c index 3f19e99b670..356631f4b64 100644 --- a/mozilla/xpinstall/wizard/windows/setup/ifuncns.c +++ b/mozilla/xpinstall/wizard/windows/setup/ifuncns.c @@ -515,9 +515,6 @@ HRESULT ProcessXpcomFile() char szMsg[MAX_BUF]; char szErrorString[MAX_BUF]; - if(*siCFXpcomFile.szMessage != '\0') - ShowMessage(siCFXpcomFile.szMessage, FALSE); - LogISProcessXpcomFile(LIS_FAILURE, dwErr); GetPrivateProfileString("Strings", "Error File Uncompress", "", szErrorString, sizeof(szErrorString), szFileIniConfig); wsprintf(szMsg, szErrorString, siCFXpcomFile.szSource, dwErr); @@ -603,14 +600,11 @@ HRESULT ProcessUncompressFile(DWORD dwTiming, char *szSectionPrefix) char szMsg[MAX_BUF]; char szErrorString[MAX_BUF]; - ShowMessage(szBuf, FALSE); GetPrivateProfileString("Strings", "Error File Uncompress", "", szErrorString, sizeof(szErrorString), szFileIniConfig); wsprintf(szMsg, szErrorString, szSource, dwErr); PrintError(szMsg, ERROR_CODE_HIDE); return(dwErr); } - - ShowMessage(szBuf, FALSE); } } @@ -1464,11 +1458,8 @@ HRESULT ProcessRunApp(DWORD dwTiming, char *szSectionPrefix) else { GetPrivateProfileString(szSection, "Message", "", szBuf, sizeof(szBuf), szFileIniConfig); - if ( szBuf[0] != '\0' ) - ShowMessage(szBuf, TRUE); + ShowMessage(szBuf, TRUE); WinSpawn(szTarget, szParameters, szWorkingDir, SW_SHOWNORMAL, bWait); - if ( szBuf[0] != '\0' ) - ShowMessage(szBuf, FALSE); } } } diff --git a/mozilla/xpinstall/wizard/windows/setup/setup.c b/mozilla/xpinstall/wizard/windows/setup/setup.c index 344872ef330..9a71208aa17 100644 --- a/mozilla/xpinstall/wizard/windows/setup/setup.c +++ b/mozilla/xpinstall/wizard/windows/setup/setup.c @@ -205,6 +205,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmd } else { + ShowMessage(NULL, FALSE); DlgSequence(NEXT_DLG); } } diff --git a/mozilla/xpinstall/wizard/windows/setup/setup.h b/mozilla/xpinstall/wizard/windows/setup/setup.h index c7bf61f56fb..0fa2d72c0a5 100644 --- a/mozilla/xpinstall/wizard/windows/setup/setup.h +++ b/mozilla/xpinstall/wizard/windows/setup/setup.h @@ -496,6 +496,7 @@ typedef struct setupStruct char greCleanupOrphansMessage[MAX_BUF]; char greID[MAX_BUF]; char grePrivateKey[MAX_BUF]; + HWND lastDialog; } setupGen; typedef struct sinfoSmartDownload @@ -652,6 +653,8 @@ struct sSysInfo DWORD dwScreenY; DWORD lastWindowPosCenterX; DWORD lastWindowPosCenterY; + BOOL lastWindowMinimized; + BOOL lastWindowIsTopWindow; BOOL bScreenReader; BOOL bRefreshIcons; }; diff --git a/mozilla/xpinstall/wizard/windows/setup/xpi.c b/mozilla/xpinstall/wizard/windows/setup/xpi.c index 5e60b8cf558..37666c2dc06 100644 --- a/mozilla/xpinstall/wizard/windows/setup/xpi.c +++ b/mozilla/xpinstall/wizard/windows/setup/xpi.c @@ -263,7 +263,7 @@ HRESULT SmartUpdateJars() } hrResult = pfnXpiInit(szBuf, FILE_INSTALL_LOG, cbXPIProgress); - ShowMessage(szMsgSmartUpdateStart, FALSE); + ShowMessage(NULL, FALSE); InitProgressDlg(); GetTotalArchivesToInstall(); SetWindowText(dlgInfo.hWndDlg, szDlgExtractingTitle); @@ -388,16 +388,13 @@ HRESULT SmartUpdateJars() siCObject = SiCNodeGetObject(dwIndex0, TRUE, AC_ALL); } /* while(siCObject) */ + SaveWindowPosition(dlgInfo.hWndDlg); //report 100% progress status for successful installs UpdateGREAppInstallerProgress(100); LogMSXPInstallStatus(NULL, hrResult); pfnXpiExit(); DeInitProgressDlg(); } - else - { - ShowMessage(szMsgSmartUpdateStart, FALSE); - } DeInitializeXPIStub(); LogISXPInstall(W_END); @@ -465,11 +462,12 @@ ProgressDlgProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { case WM_INITDIALOG: DisableSystemMenuItems(hWndDlg, TRUE); - RepositionWindow(hWndDlg, BANNER_IMAGE_INSTALLING); SendDlgItemMessage (hWndDlg, IDC_STATUS0, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); SendDlgItemMessage (hWndDlg, IDC_GAUGE_ARCHIVE, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); SendDlgItemMessage (hWndDlg, IDC_STATUS3, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); SendDlgItemMessage (hWndDlg, IDC_GAUGE_FILE, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); + RepositionWindow(hWndDlg, BANNER_IMAGE_INSTALLING); + ClosePreviousDialog(); return FALSE; case WM_COMMAND: diff --git a/mozilla/xpinstall/wizard/windows/setup/xpnetHook.cpp b/mozilla/xpinstall/wizard/windows/setup/xpnetHook.cpp index 864887d07a0..90d5ae4927d 100644 --- a/mozilla/xpinstall/wizard/windows/setup/xpnetHook.cpp +++ b/mozilla/xpinstall/wizard/windows/setup/xpnetHook.cpp @@ -908,6 +908,7 @@ int DownloadFiles(char *szInputIniFile, GetSetupCurrentDownloadFile(szPartiallyDownloadedFilename, sizeof(szPartiallyDownloadedFilename)); + ShowMessage(NULL, FALSE); InitDownloadDlg(); for(giIndex = 0; giIndex < giTotalArchivesToDownload; giIndex++) @@ -1258,7 +1259,6 @@ DownloadDlgProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam) sizeof(gszFileInfo), szFileIniConfig); DisableSystemMenuItems(hWndDlg, FALSE); - RepositionWindow(hWndDlg, BANNER_IMAGE_DOWNLOAD); if(gbShowDownloadRetryMsg) SetDlgItemText(hWndDlg, IDC_MESSAGE0, diDownload.szMessageRetry0); else @@ -1283,6 +1283,8 @@ DownloadDlgProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam) SendDlgItemMessage (hWndDlg, IDC_STATUS_FILE, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); SendDlgItemMessage (hWndDlg, IDC_STATUS_URL, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); SendDlgItemMessage (hWndDlg, IDC_STATUS_TO, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); + RepositionWindow(hWndDlg, BANNER_IMAGE_DOWNLOAD); + ClosePreviousDialog(); return FALSE; case WM_SIZE: diff --git a/mozilla/xpinstall/wizard/windows/setuprsc/setuprsc.rc b/mozilla/xpinstall/wizard/windows/setuprsc/setuprsc.rc index 79bb70f82bb..f2cd407204f 100644 --- a/mozilla/xpinstall/wizard/windows/setuprsc/setuprsc.rc +++ b/mozilla/xpinstall/wizard/windows/setuprsc/setuprsc.rc @@ -248,6 +248,7 @@ END DLG_MESSAGE DIALOG DISCARDABLE 0, 0, 236, 34 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION +STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CLASS "MozillaSetupDlg" FONT 8, "MS Sans Serif" BEGIN diff --git a/mozilla/xpinstall/wizard/windows/uninstall/parser.c b/mozilla/xpinstall/wizard/windows/uninstall/parser.c index 78c746718bf..e1e06354aa5 100644 --- a/mozilla/xpinstall/wizard/windows/uninstall/parser.c +++ b/mozilla/xpinstall/wizard/windows/uninstall/parser.c @@ -439,9 +439,7 @@ DWORD DecrementSharedFileCounter(char *file) { result = RegQueryValueEx(keyHandle, file, NULL, &type, (LPBYTE)&valbuf, (LPDWORD)&valbufsize); if((ERROR_SUCCESS == result) && (type == REG_DWORD)) - { - rv = --valbuf; - } + rv = valbuf = ((long)valbuf - 1) < 0 ? 0 : (valbuf - 1); RegSetValueEx(keyHandle, file, 0, REG_DWORD, (LPBYTE)&valbuf, valbufsize); RegCloseKey(keyHandle); @@ -594,20 +592,21 @@ DWORD Uninstall(sil* silInstallLogHead) if(DetermineUnRegisterServer(silInstallLogHead, szFile) == TRUE) UnregisterServer(szFile); } - else if(((szSubStr = strstr(szLCLine, KEY_INSTALLING_SHARED_FILE)) != NULL) && + else if((((szSubStr = strstr(szLCLine, KEY_INSTALLING_SHARED_FILE)) != NULL) || + ((szSubStr = strstr(szLCLine, KEY_REPLACING_SHARED_FILE)) != NULL)) && (strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL)) { /* check for "Installing Shared File: " string and delete the file */ ParseForFile(szSubStr, KEY_INSTALLING_SHARED_FILE, szFile, sizeof(szFile)); if(DecrementSharedFileCounter(szFile) == 0) { - if((gdwWhatToDo != WTD_NO_TO_ALL) && (gdwWhatToDo != WTD_YES_TO_ALL)) + if((gdwWhatToDo != WTD_NO_TO_ALL) && (gdwWhatToDo != WTD_YES_TO_ALL) && FileExists(szFile)) { MessageBeep(MB_ICONEXCLAMATION); gdwWhatToDo = DialogBoxParam(hInst, MAKEINTRESOURCE(DLG_WHAT_TO_DO), hDlgUninstall, DlgProcWhatToDo, (LPARAM)szFile); } - if((gdwWhatToDo == WTD_YES) || (gdwWhatToDo == WTD_YES_TO_ALL)) + if((gdwWhatToDo == WTD_YES) || (gdwWhatToDo == WTD_YES_TO_ALL) || !FileExists(szFile)) { DeleteWinRegValue(HKEY_LOCAL_MACHINE, KEY_SHARED_DLLS, szFile); DeleteOrDelayUntilReboot(szFile); @@ -623,25 +622,6 @@ DWORD Uninstall(sil* silInstallLogHead) ParseForFile(szSubStr, KEY_INSTALLING, szFile, sizeof(szFile)); DeleteOrDelayUntilReboot(szFile); } - else if(((szSubStr = strstr(szLCLine, KEY_REPLACING_SHARED_FILE)) != NULL) && - (strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL)) - { - /* check for "Replacing Shared File: " string and delete the file */ - ParseForFile(szSubStr, KEY_REPLACING_SHARED_FILE, szFile, sizeof(szFile)); - if(DecrementSharedFileCounter(szFile) == 0) - { - if((gdwWhatToDo != WTD_NO_TO_ALL) && (gdwWhatToDo != WTD_YES_TO_ALL)) - gdwWhatToDo = DialogBoxParam(hInst, MAKEINTRESOURCE(DLG_WHAT_TO_DO), hDlgUninstall, DlgProcWhatToDo, (LPARAM)szFile); - - if((gdwWhatToDo == WTD_YES) || (gdwWhatToDo == WTD_YES_TO_ALL)) - { - DeleteWinRegValue(HKEY_LOCAL_MACHINE, KEY_SHARED_DLLS, szFile); - DeleteOrDelayUntilReboot(szFile); - } - else if(gdwWhatToDo == WTD_CANCEL) - return(WTD_CANCEL); - } - } else if(((szSubStr = strstr(szLCLine, KEY_REPLACING)) != NULL) && (strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL)) {