225281 - checkbox label background problem on "install complete" page - patch by Son Le <lesx99@lycos.com> r+a=ben@mozilla.org

This commit is contained in:
ben%bengoodger.com 2004-10-15 23:38:05 +00:00
Родитель 85f9788c5d
Коммит 7a9514dcf3
5 изменённых файлов: 84 добавлений и 14 удалений

Просмотреть файл

@ -28,7 +28,7 @@
// needed to build with mingw // needed to build with mingw
#ifndef _WIN32_IE #ifndef _WIN32_IE
#define _WIN32_IE 0x0400 #define _WIN32_IE 0x0500
#endif #endif
#include "extern.h" #include "extern.h"
@ -51,9 +51,13 @@
#define DEFAULT_SAFE_UPGRADE FALSE #define DEFAULT_SAFE_UPGRADE FALSE
static WNDPROC OldListBoxWndProc; static WNDPROC OldListBoxWndProc;
static WNDPROC OldDialogWndProc;
static DWORD gdwACFlag; static DWORD gdwACFlag;
static BOOL gDidShowUpgradePanel; static BOOL gDidShowUpgradePanel;
// function prototype
LRESULT CALLBACK NewDialogWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// INSTALL WIZARD SEQUENCER // INSTALL WIZARD SEQUENCER
// //
@ -195,8 +199,7 @@ void InitSequence(HINSTANCE hInstance)
psh.hInstance = hSetupRscInst; psh.hInstance = hSetupRscInst;
psh.hwndParent = NULL; psh.hwndParent = NULL;
psh.phpage = pages; psh.phpage = pages;
psh.dwFlags = PSH_WIZARD97|PSH_WATERMARK|PSH_HEADER; psh.dwFlags = PSH_WIZARD97|PSH_HEADER;
psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER); psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
psh.nStartPage = 0; psh.nStartPage = 0;
psh.nPages = count; psh.nPages = count;
@ -305,6 +308,8 @@ LRESULT CALLBACK DlgProcWelcome(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
wsprintf(szBuf, diWelcome.szMessage3, sgProduct.szProductName); wsprintf(szBuf, diWelcome.szMessage3, sgProduct.szProductName);
SetDlgItemText(hDlg, IDC_STATIC3, szBuf); SetDlgItemText(hDlg, IDC_STATIC3, szBuf);
// Subclass dialog to paint all static controls white.
OldDialogWndProc = SubclassWindow(hDlg, (WNDPROC)NewDialogWndProc);
break; break;
case WM_NOTIFY: case WM_NOTIFY:
@ -1084,6 +1089,22 @@ WNDPROC SubclassWindow( HWND hWnd, WNDPROC NewWndProc)
return OldWndProc; return OldWndProc;
} }
// ************************************************************************
// FUNCTION : NewDialogWndProc( HWND, UINT, WPARAM, LPARAM )
// PURPOSE : Processes messages for the Welcome and Finish dialogs.
// COMMENTS : Paints all static control backgrounds in white.
// ************************************************************************
LRESULT CALLBACK NewDialogWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_CTLCOLORSTATIC:
return (HRESULT)GetStockObject(WHITE_BRUSH);
}
return(CallWindowProc(OldDialogWndProc, hWnd, uMsg, wParam, lParam));
}
// ************************************************************************ // ************************************************************************
// FUNCTION : NewListBoxWndProc( HWND, UINT, WPARAM, LPARAM ) // FUNCTION : NewListBoxWndProc( HWND, UINT, WPARAM, LPARAM )
// PURPOSE : Processes messages for "LISTBOX" class. // PURPOSE : Processes messages for "LISTBOX" class.
@ -1982,6 +2003,9 @@ LRESULT CALLBACK DlgProcInstallSuccessful(HWND hDlg, UINT msg, WPARAM wParam, LO
LPNMHDR notifyMessage; LPNMHDR notifyMessage;
HWND ctrl; HWND ctrl;
static BOOL launchAppChecked = TRUE; static BOOL launchAppChecked = TRUE;
static BOOL resetHomepageChecked = TRUE;
DWORD result;
HKEY theKey;
switch(msg) { switch(msg) {
case WM_INITDIALOG: case WM_INITDIALOG:
@ -1996,9 +2020,18 @@ LRESULT CALLBACK DlgProcInstallSuccessful(HWND hDlg, UINT msg, WPARAM wParam, LO
SetDlgItemText(hDlg, IDC_STATIC1, diInstallSuccessful.szMessage1); SetDlgItemText(hDlg, IDC_STATIC1, diInstallSuccessful.szMessage1);
wsprintf(szBuf, diInstallSuccessful.szLaunchApp, sgProduct.szProductName); wsprintf(szBuf, diInstallSuccessful.szLaunchApp, sgProduct.szProductName);
SetDlgItemText(hDlg, IDC_START_APP, szBuf); SetDlgItemText(hDlg, IDC_START_APP, szBuf);
SetDlgItemText(hDlg, IDC_RESET_HOMEPAGE, diInstallSuccessful.szResetHomepage);
#ifndef MOZ_PHOENIX
// Hide the "Reset Homepage" item for non-Firefox installers.
ShowWindow(GetDlgItem(hDlg, IDC_RESET_HOMEPAGE), SW_HIDE);
#endif
launchAppChecked = diInstallSuccessful.bLaunchAppChecked; launchAppChecked = diInstallSuccessful.bLaunchAppChecked;
resetHomepageChecked = diInstallSuccessful.bResetHomepageChecked;
// Subclass dialog to paint all static controls white.
OldDialogWndProc = SubclassWindow(hDlg, (WNDPROC)NewDialogWndProc);
break; break;
case WM_NOTIFY: case WM_NOTIFY:
@ -2011,6 +2044,8 @@ LRESULT CALLBACK DlgProcInstallSuccessful(HWND hDlg, UINT msg, WPARAM wParam, LO
// Restore state from default or cached value. // Restore state from default or cached value.
CheckDlgButton(hDlg, IDC_START_APP, CheckDlgButton(hDlg, IDC_START_APP,
launchAppChecked ? BST_CHECKED : BST_UNCHECKED); launchAppChecked ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg, IDC_RESET_HOMEPAGE,
resetHomepageChecked ? BST_CHECKED : BST_UNCHECKED);
// Don't show the back button here UNLESS the previous // Don't show the back button here UNLESS the previous
// page was Windows Integration - and that only happens on a custom // page was Windows Integration - and that only happens on a custom
@ -2022,10 +2057,26 @@ LRESULT CALLBACK DlgProcInstallSuccessful(HWND hDlg, UINT msg, WPARAM wParam, LO
// Store the checkbox state in case the user goes back to any post-install // Store the checkbox state in case the user goes back to any post-install
// pages that we might add. // pages that we might add.
launchAppChecked = IsDlgButtonChecked(hDlg, IDC_START_APP) == BST_CHECKED; launchAppChecked = IsDlgButtonChecked(hDlg, IDC_START_APP) == BST_CHECKED;
resetHomepageChecked = IsDlgButtonChecked(hDlg, IDC_RESET_HOMEPAGE) == BST_CHECKED;
break; break;
case PSN_WIZFINISH: case PSN_WIZFINISH:
#ifdef MOZ_PHOENIX
// Store the "Reset Homepage" preference in the Registry.
resetHomepageChecked = IsDlgButtonChecked(hDlg, IDC_RESET_HOMEPAGE) == BST_CHECKED;
if (resetHomepageChecked) {
result = RegOpenKeyEx(HKEY_CURRENT_USER, diInstallSuccessful.szRegistryKey, 0, KEY_READ | KEY_WRITE, &theKey);
if (result == ERROR_FILE_NOT_FOUND)
result = RegCreateKey(HKEY_CURRENT_USER, diInstallSuccessful.szRegistryKey, &theKey);
if (result == ERROR_SUCCESS) {
RegSetValueEx(theKey, "Reset Home Page", 0, REG_DWORD,
(LPBYTE)&(resetHomepageChecked),
sizeof(DWORD));
}
}
#endif
// Store state from the "Run App Now" checkbox. ProcessFileOpsForAll // Store state from the "Run App Now" checkbox. ProcessFileOpsForAll
// uses this variable to decide whether or not to launch the browser. // uses this variable to decide whether or not to launch the browser.
gbIgnoreRunAppX = IsDlgButtonChecked(hDlg, IDC_START_APP) != BST_CHECKED; gbIgnoreRunAppX = IsDlgButtonChecked(hDlg, IDC_START_APP) != BST_CHECKED;
@ -2290,3 +2341,4 @@ void InitPathDisplay (HWND aWindow, char* aPath, int aFolderIcon, int aFolderFie
SetDlgItemText(aWindow, aFolderField, buf); SetDlgItemText(aWindow, aFolderField, buf);
} }

Просмотреть файл

@ -3786,6 +3786,7 @@ HRESULT InitDlgInstallSuccessful(diIS *diDialog)
{ {
diDialog->bShowDialog = FALSE; diDialog->bShowDialog = FALSE;
diDialog->bLaunchAppChecked = TRUE; diDialog->bLaunchAppChecked = TRUE;
diDialog->bResetHomepageChecked = TRUE;
if((diDialog->szTitle = NS_GlobalAlloc(MAX_BUF)) == NULL) if((diDialog->szTitle = NS_GlobalAlloc(MAX_BUF)) == NULL)
return(1); return(1);
if((diDialog->szMessage0 = NS_GlobalAlloc(MAX_BUF)) == NULL) if((diDialog->szMessage0 = NS_GlobalAlloc(MAX_BUF)) == NULL)
@ -3794,6 +3795,10 @@ HRESULT InitDlgInstallSuccessful(diIS *diDialog)
return(1); return(1);
if((diDialog->szLaunchApp = NS_GlobalAlloc(MAX_BUF)) == NULL) if((diDialog->szLaunchApp = NS_GlobalAlloc(MAX_BUF)) == NULL)
return(1); return(1);
if((diDialog->szResetHomepage = NS_GlobalAlloc(MAX_BUF)) == NULL)
return(1);
if((diDialog->szRegistryKey = NS_GlobalAlloc(MAX_BUF)) == NULL)
return(1);
if((diDialog->szMessageHeader = NS_GlobalAlloc(MAX_BUF)) == NULL) if((diDialog->szMessageHeader = NS_GlobalAlloc(MAX_BUF)) == NULL)
return(1); return(1);
@ -3806,6 +3811,8 @@ void DeInitDlgInstallSuccessful(diIS *diDialog)
FreeMemory(&(diDialog->szMessage0)); FreeMemory(&(diDialog->szMessage0));
FreeMemory(&(diDialog->szMessage1)); FreeMemory(&(diDialog->szMessage1));
FreeMemory(&(diDialog->szLaunchApp)); FreeMemory(&(diDialog->szLaunchApp));
FreeMemory(&(diDialog->szResetHomepage));
FreeMemory(&(diDialog->szRegistryKey));
FreeMemory(&(diDialog->szMessageHeader)); FreeMemory(&(diDialog->szMessageHeader));
} }
@ -7298,6 +7305,8 @@ HRESULT ParseConfigIni(LPSTR lpszCmdLine)
} }
/* get main install path */ /* get main install path */
// goats VerifyRestrictedAccess
if(LocatePreviousPath("Locate Previous Product Path", szPreviousPath, sizeof(szPreviousPath)) == FALSE) if(LocatePreviousPath("Locate Previous Product Path", szPreviousPath, sizeof(szPreviousPath)) == FALSE)
{ {
GetPrivateProfileString("General", "Path", "", szBuf, sizeof(szBuf), szFileIniConfig); GetPrivateProfileString("General", "Path", "", szBuf, sizeof(szBuf), szFileIniConfig);
@ -7654,6 +7663,11 @@ HRESULT ParseConfigIni(LPSTR lpszCmdLine)
GetPrivateProfileString("Dialog Install Successful", "Launch App Checked", "", szShowDialog, MAX_BUF, szFileIniConfig); GetPrivateProfileString("Dialog Install Successful", "Launch App Checked", "", szShowDialog, MAX_BUF, szFileIniConfig);
if(lstrcmpi(szShowDialog, "TRUE") == 0) if(lstrcmpi(szShowDialog, "TRUE") == 0)
diInstallSuccessful.bLaunchAppChecked = TRUE; diInstallSuccessful.bLaunchAppChecked = TRUE;
GetPrivateProfileString("Dialog Install Successful", "Reset Homepage", "", diInstallSuccessful.szResetHomepage, MAX_BUF, szFileIniConfig);
GetPrivateProfileString("Dialog Install Successful", "Reset Homepage Checked", "", szShowDialog, MAX_BUF, szFileIniConfig);
if(lstrcmpi(szShowDialog, "TRUE") == 0)
diInstallSuccessful.bResetHomepageChecked = TRUE;
GetPrivateProfileString("Dialog Install Successful", "Registry Key", "", diInstallSuccessful.szRegistryKey, MAX_BUF, szFileIniConfig);
/* Download dialog */ /* Download dialog */
GetPrivateProfileString("Dialog Download", "Show Dialog", "", szShowDialog, sizeof(szShowDialog), szFileIniConfig); GetPrivateProfileString("Dialog Download", "Show Dialog", "", szShowDialog, sizeof(szShowDialog), szFileIniConfig);

Просмотреть файл

@ -489,7 +489,10 @@ typedef struct dlgInstallSuccessful
LPSTR szMessageHeader; LPSTR szMessageHeader;
LPSTR szMessage0; LPSTR szMessage0;
LPSTR szMessage1; LPSTR szMessage1;
LPSTR szResetHomepage;
LPSTR szRegistryKey;
LPSTR szLaunchApp; LPSTR szLaunchApp;
BOOL bResetHomepageChecked;
BOOL bLaunchAppChecked; BOOL bLaunchAppChecked;
} diIS; } diIS;

Просмотреть файл

@ -2,25 +2,19 @@
// Microsoft Developer Studio generated include file. // Microsoft Developer Studio generated include file.
// Used by setuprsc.rc // Used by setuprsc.rc
// //
#ifndef WINVER
#define WINVER 0x0400
#endif
#include "winresrc.h"
#define IDS_ERROR_FILE_NOT_FOUND 3 #define IDS_ERROR_FILE_NOT_FOUND 3
#define IDRESUME 3 #define IDRESUME 3
#define IDPAUSE 4 #define IDPAUSE 4
#define IDS_MSG_RETRIEVE_INSTALLINI 11 #define IDS_MSG_RETRIEVE_INSTALLINI 11
#define IDI_SETUP 105 #define IDI_SETUP 105
#define IDI_APP 106 #define IDI_APP 106
#define IDB_BITMAP_WELCOME 108 #define IDB_BITMAP_WELCOME 108
#define DLG_MESSAGE 110 #define DLG_MESSAGE 110
#define IDB_BITMAP_BANNER 114 #define IDB_BITMAP_BANNER 114
#define IDB_QUICK_LAUNCH 115 #define IDB_QUICK_LAUNCH 115
#define IDB_HEADER 116 #define IDB_HEADER 116
#define IDB_WATERMARK 117 #define IDB_WATERMARK 117
#define DLG_SELECT_INSTALL_PATH 118 #define DLG_SELECT_INSTALL_PATH 118
#define DLG_BROWSE_DIR 503 #define DLG_BROWSE_DIR 503
#define IDC_STATUS 1001 #define IDC_STATUS 1001
#define IDC_STATUS1 1001 #define IDC_STATUS1 1001
@ -116,6 +110,7 @@
#define DLG_INSTALL_SUCCESSFUL 1089 #define DLG_INSTALL_SUCCESSFUL 1089
#define IDC_START_APP 1090 #define IDC_START_APP 1090
#define IDC_MESSAGE_UPGRADE 1091 #define IDC_MESSAGE_UPGRADE 1091
#define IDC_RESET_HOMEPAGE 1091
#define IDC_CHECK_SAFE_INSTALL 1092 #define IDC_CHECK_SAFE_INSTALL 1092
#define IDC_MESSAGE_INFO 1093 #define IDC_MESSAGE_INFO 1093
#define IDC_APP_ICON 1094 #define IDC_APP_ICON 1094

Просмотреть файл

@ -1,5 +1,6 @@
//Microsoft Developer Studio generated resource script. //Microsoft Developer Studio generated resource script.
// //
#include <windows.h>
#include "setuprsc.h" #include "setuprsc.h"
#define APSTUDIO_READONLY_SYMBOLS #define APSTUDIO_READONLY_SYMBOLS
@ -58,6 +59,7 @@ STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
CLASS "MozillaSetupDlg" CLASS "MozillaSetupDlg"
FONT 8, "MS Sans Serif" FONT 8, "MS Sans Serif"
BEGIN BEGIN
CONTROL IDB_WATERMARK,IDC_STATIC,"Static",SS_BITMAP,0,0,497,313
LTEXT "",IDC_STATIC_TITLE,130,8,180,18,NOT WS_GROUP LTEXT "",IDC_STATIC_TITLE,130,8,180,18,NOT WS_GROUP
LTEXT "",IDC_STATIC1,130,58,180,24,NOT WS_GROUP LTEXT "",IDC_STATIC1,130,58,180,24,NOT WS_GROUP
LTEXT "",IDC_STATIC2,130,90,180,37,NOT WS_GROUP LTEXT "",IDC_STATIC2,130,90,180,37,NOT WS_GROUP
@ -359,15 +361,18 @@ BEGIN
ICON "",IDC_FOLDER_ICON,28,22,20,20 ICON "",IDC_FOLDER_ICON,28,22,20,20
END END
DLG_INSTALL_SUCCESSFUL DIALOGEX 0, 0, 317, 193 DLG_INSTALL_SUCCESSFUL DIALOG DISCARDABLE 0, 0, 317, 193
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif", 0, 0, 0x1 FONT 8, "MS Sans Serif"
BEGIN BEGIN
CONTROL IDB_WATERMARK,IDC_STATIC,"Static",SS_BITMAP,0,0,497,313
LTEXT "",IDC_STATIC_TITLE,130,8,180,18,NOT WS_GROUP LTEXT "",IDC_STATIC_TITLE,130,8,180,18,NOT WS_GROUP
LTEXT "",IDC_STATIC1,130,169,180,15 LTEXT "",IDC_STATIC1,130,169,180,15
LTEXT "",IDC_STATIC0,130,34,180,16,NOT WS_GROUP LTEXT "",IDC_STATIC0,130,34,180,16,NOT WS_GROUP
CONTROL "",IDC_START_APP,"Button",BS_AUTOCHECKBOX | BS_NOTIFY | CONTROL "",IDC_START_APP,"Button",BS_AUTOCHECKBOX | BS_NOTIFY |
WS_TABSTOP,130,139,180,10,WS_EX_TRANSPARENT WS_TABSTOP,130,139,180,10
CONTROL "",IDC_RESET_HOMEPAGE,"Button",BS_AUTOCHECKBOX | BS_NOTIFY |
WS_TABSTOP,130,124,180,10
END END
@ -476,3 +481,4 @@ END
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED #endif // not APSTUDIO_INVOKED