Reapplying patch that was used to back out yesterday's blocker bug:

bug 203194 - Installation fails after GRE setup

This patch fixes the blocker bug and the following bugs it backed out:
  bug 48051  - Restart dialog needs title
  bug 67067  - "unable to create directory" dialog is titleless
  bug 202606 - Need a way to disable showing of bitmap in dialog

r=sgehani
sr=leaf
a=sspitzer
This commit is contained in:
ssu%netscape.com 2003-04-25 07:10:10 +00:00
parent 4e0ef16242
commit fb411dc80b
18 changed files with 492 additions and 253 deletions

View File

@ -744,8 +744,7 @@ Message Cancel Setup AUTO mode=Canceling Setup, please wait...
;*** LOCALIZE ME BABY ***
Error File Uncompress=Error uncompressing file %s: %d
;*** LOCALIZE ME BABY ***
;UsageMsg Usage must not have more than 20 lines. (Each %s becomes a line)
UsageMsg Usage=Usage: %s [options]%s [options] can be any of the following combination:%s -h: This help.%s -a [path]: Alternate archive search path.%s -app [id]: ID of app which is launching the installer%s -app_path [path]: Points to representative file of the app%s -dd [path]: Suggested install destination direcotory%s -f: Force install%s -n [filename]: Setup's parent's process filename.%s -ma: Run setup in Auto mode.%s -mmi: Allow multiple installer instances%s -ms: Run setup in Silent mode.%s -ira: Ignore the [RunAppX] sections%s -ispf: Ignore the [Program FolderX] sections that show%s the Start Menu shortcut folder at the end of installation.%s -reg_path [path]: Where to make entries in the Windows registry.
UsageMsg Usage=Usage: %s [options]\n [options] can be any of the following combination:\n -h: This help.\n -a [path]: Alternate archive search path.\n -app [app id]: ID of application which is launching the installer (shared installs)\n -app_path [app]: Points to (full path) representative file of application (Shared installs)\n * -dd [path]: Suggested install destination directory. (Shared installs)\n * -greLocal: Forces GRE to be installed into the application dir.\n * -greShared: Forces GRE to be installed into a global, shared dir (normally)\n c:\program files\common files\mozilla.org\GRE\n -reg_path [path]: Where to make entries in the Windows registry. (Shared installs)\n -f: Force install of GRE installer (Shared installs), though it'll work\n for non GRE installers too.\n -greForce: Force 'Component GRE' to be downloaded, run, and installed. This\n bypasses GRE's logic of determining when to install by running its\n installer with a '-f' flag.\n -n [filename]: Setup's parent process filename.\n * -ma: Run setup in Auto mode.\n * -ms: Run setup in Silent mode.\n -ira: Ignore the [RunAppX] sections\n -ispf: Ignore the [Program FolderX] sections that show\n the Start Menu shortcut folder at the end of installation.\n * -showBanner: Show the banner image in the download and install progress dialogs\n * -hideBanner: Hide the banner image in the download and install progress dialogs\n\n * means it will override config.ini
;*** LOCALIZE ME BABY ***
IDC Use FTP=Use &FTP for downloading files
;*** LOCALIZE ME BABY ***

View File

@ -35,7 +35,8 @@ ACCEPT_=&Accept
DECLINE_=&Decline
PROGRAMFOLDER_=&Program Folder:
EXISTINGFOLDERS_=E&xisting Folders:
SETUPMESSAGE=Setup has finished copying files to your computer. Before you can use the program, you must restart Windows or your computer. Choose one of the following options and click OK to finish setup.
SETUPMESSAGE=Setup has finished copying files to your computer. Before you can use $ProductNameInternal$, you must restart Windows or your computer. Choose one of the following options and click OK to finish setup.
RESTART=Restart
YESRESTART=Yes, I want to restart my computer now.
NORESTART=No, I will restart my computer later.
ADDITIONALCOMPONENTS_=&Additional Components:
@ -77,6 +78,7 @@ DLG_DISK_SPACE_CHECK_TITLE=Disk space check
DLG_DISK_SPACE_CHECK_CRUTIAL_MSG=Setup has detected insufficient disk space to continue with installation on %s for the path: %sRequired: %sAvailable: %sClick Retry if more disk space has been made available, or click Cancel to cancel Setup.
DLG_DISK_SPACE_CHECK_MSG=Setup has detected insufficient disk space to continue with installation process on %s for the path: %sRequired: %sAvailable: %sClick OK to go back and choose a different destination path.
ERROR_CREATE_DIRECTORY=Could not create folder: %sMake sure you have access to create the folder.
ERROR_MESSAGE_TITLE=$ProductNameInternal$ Setup Error
STR_FILE_NUMBER=File count:
STR_FILENAME=Filename:
MSG_SMARTUPDATE_START=Preparing Install, please wait...
@ -106,7 +108,7 @@ STR_SAVE_INSTALLER_FILES=Save downloaded and Setup program files to:
MSG_INIT_SETUP=Initializing Setup, please wait...
STR_MESSAGEBOX_TITLE=%s Setup
ERROR_GETVERSION=GetVersionEx() failed!
TITLE_USAGE=Usage
DLG_USAGE_TITLE=Usage
STATUS_EXTRACTING=Extracting %s
STATUS_LAUNCHING_SETUP=Launching Setup...

View File

@ -119,7 +119,11 @@ GRE Type=Shared
; config.ini file) will be appended as follows:
;
; Software\mozilla.org\GRE_1.4a_00000000_PRIVATE_[Product Name Internal]
GRE Private Key=Software\mozilla.org\GRE_$GreUniqueID$_PRIVATE
GRE Private Key=Software\mozilla.org\GRE_$GreUniqueID$_PRIVATE_%ProductNameInternal$
; Controls the display of the banner image in the download and install progress dialogs.
; Default value is TRUE.
Show Banner Image=TRUE
; This section contains info on how to send error information in case of
; either a download or xpinstall error.
@ -730,7 +734,7 @@ Message Cancel Setup AUTO mode=Canceling Setup, please wait...
;*** LOCALIZE ME BABY ***
Error File Uncompress=Error uncompressing file %s: %d
;*** LOCALIZE ME BABY ***
UsageMsg Usage=Usage: %s [options]%s [options] can be any of the following combination:%s -h: This help.%s -a [path]: Alternate archive search path.%s -n [filename]: Setup's parent's process filename.%s -ma: Run setup in Auto mode.%s -ms: Run setup in Silent mode.%s -ira: Ignore the [RunAppX] sections%s -ispf: Ignore the [Program FolderX] sections that show%s the Start Menu shortcut folder at the end of installation.
UsageMsg Usage=Usage: %s [options]\n [options] can be any of the following combination:\n -h: This help.\n -a [path]: Alternate archive search path.\n -app [app id]: ID of application which is launching the installer (shared installs)\n -app_path [app]: Points to (full path) representative file of application (Shared installs)\n * -dd [path]: Suggested install destination directory. (Shared installs)\n * -greLocal: Forces GRE to be installed into the application dir.\n * -greShared: Forces GRE to be installed into a global, shared dir (normally)\n c:\program files\common files\mozilla.org\GRE\n -reg_path [path]: Where to make entries in the Windows registry. (Shared installs)\n -f: Force install of GRE installer (Shared installs), though it'll work\n for non GRE installers too.\n -greForce: Force 'Component GRE' to be downloaded, run, and installed. This\n bypasses GRE's logic of determining when to install by running its\n installer with a '-f' flag.\n -n [filename]: Setup's parent process filename.\n * -ma: Run setup in Auto mode.\n * -ms: Run setup in Silent mode.\n -ira: Ignore the [RunAppX] sections\n -ispf: Ignore the [Program FolderX] sections that show\n the Start Menu shortcut folder at the end of installation.\n * -showBanner: Show the banner image in the download and install progress dialogs\n * -hideBanner: Hide the banner image in the download and install progress dialogs\n\n * means it will override config.ini
;*** LOCALIZE ME BABY ***
IDC Use FTP=Use &FTP for downloading files
;*** LOCALIZE ME BABY ***

View File

@ -35,7 +35,8 @@ ACCEPT_=&Accept
DECLINE_=&Decline
PROGRAMFOLDER_=&Program Folder:
EXISTINGFOLDERS_=E&xisting Folders:
SETUPMESSAGE=Setup has finished copying files to your computer. Before you can use the program, you must restart Windows or your computer. Choose one of the following options and click OK to finish setup.
SETUPMESSAGE=Setup has finished copying files to your computer. Before you can use $ProductNameInternal$, you must restart Windows or your computer. Choose one of the following options and click OK to finish setup.
RESTART=Restart
YESRESTART=Yes, I want to restart my computer now.
NORESTART=No, I will restart my computer later.
ADDITIONALCOMPONENTS_=&Additional Components:
@ -77,6 +78,7 @@ DLG_DISK_SPACE_CHECK_TITLE=Disk space check
DLG_DISK_SPACE_CHECK_CRUTIAL_MSG=Setup has detected insufficient disk space to continue with installation on %s for the path: %sRequired: %sAvailable: %sClick Retry if more disk space has been made available, or click Cancel to cancel Setup.
DLG_DISK_SPACE_CHECK_MSG=Setup has detected insufficient disk space to continue with installation process on %s for the path: %sRequired: %sAvailable: %sClick OK to go back and choose a different destination path.
ERROR_CREATE_DIRECTORY=Could not create folder: %sMake sure you have access to create the folder.
ERROR_MESSAGE_TITLE=$ProductNameInternal$ Setup Error
STR_FILE_NUMBER=File count:
STR_FILENAME=Filename:
MSG_SMARTUPDATE_START=Preparing Install, please wait...
@ -106,7 +108,7 @@ STR_SAVE_INSTALLER_FILES=Save downloaded and Setup program files to:
MSG_INIT_SETUP=Initializing Setup, please wait...
STR_MESSAGEBOX_TITLE=%s Setup
ERROR_GETVERSION=GetVersionEx() failed!
TITLE_USAGE=Usage
DLG_USAGE_TITLE=Usage
STATUS_EXTRACTING=Extracting %s
STATUS_LAUNCHING_SETUP=Launching Setup...

View File

@ -116,7 +116,11 @@ GRE Type=Shared
; config.ini file) will be appended as follows:
;
; Software\mozilla.org\GRE_1.4a_0000000000_PRIVATE_[Product Name Internal]
GRE Private Key=Software\mozilla.org\GRE_$GreUniqueID$_PRIVATE
GRE Private Key=Software\mozilla.org\GRE_$GreUniqueID$_PRIVATE_$ProductNameInternal$
; Controls the display of the banner image in the download and install progress dialogs.
; Default value is TRUE.
Show Banner Image=TRUE
; This section contains info on how to send error information in case of
; either a download or xpinstall error.
@ -1165,7 +1169,7 @@ Message Cancel Setup AUTO mode=Canceling Setup, please wait...
;*** LOCALIZE ME BABY ***
Error File Uncompress=Error uncompressing file %s: %d
;*** LOCALIZE ME BABY ***
UsageMsg Usage=Usage: %s [options]%s [options] can be any of the following combination:%s -h: This help.%s -a [path]: Alternate archive search path.%s -n [filename]: Setup's parent's process filename.%s -ma: Run setup in Auto mode.%s -ms: Run setup in Silent mode.%s -ira: Ignore the [RunAppX] sections%s -ispf: Ignore the [Program FolderX] sections that show%s the Start Menu shortcut folder at the end of installation.
UsageMsg Usage=Usage: %s [options]\n [options] can be any of the following combination:\n -h: This help.\n -a [path]: Alternate archive search path.\n -app [app id]: ID of application which is launching the installer (shared installs)\n -app_path [app]: Points to (full path) representative file of application (Shared installs)\n * -dd [path]: Suggested install destination directory. (Shared installs)\n * -greLocal: Forces GRE to be installed into the application dir.\n * -greShared: Forces GRE to be installed into a global, shared dir (normally)\n c:\program files\common files\mozilla.org\GRE\n -reg_path [path]: Where to make entries in the Windows registry. (Shared installs)\n -f: Force install of GRE installer (Shared installs), though it'll work\n for non GRE installers too.\n -greForce: Force 'Component GRE' to be downloaded, run, and installed. This\n bypasses GRE's logic of determining when to install by running its\n installer with a '-f' flag.\n -n [filename]: Setup's parent process filename.\n * -ma: Run setup in Auto mode.\n * -ms: Run setup in Silent mode.\n -ira: Ignore the [RunAppX] sections\n -ispf: Ignore the [Program FolderX] sections that show\n the Start Menu shortcut folder at the end of installation.\n * -showBanner: Show the banner image in the download and install progress dialogs\n * -hideBanner: Hide the banner image in the download and install progress dialogs\n\n * means it will override config.ini
;*** LOCALIZE ME BABY ***
IDC Use FTP=Use &FTP for downloading files
;*** LOCALIZE ME BABY ***

View File

@ -35,7 +35,8 @@ ACCEPT_=&Accept
DECLINE_=&Decline
PROGRAMFOLDER_=&Program Folder:
EXISTINGFOLDERS_=E&xisting Folders:
SETUPMESSAGE=Setup has finished copying files to your computer. Before you can use the program, you must restart Windows or your computer. Choose one of the following options and click OK to finish setup.
SETUPMESSAGE=Setup has finished copying files to your computer. Before you can use $ProductNameInternal$, you must restart Windows or your computer. Choose one of the following options and click OK to finish setup.
RESTART=Restart
YESRESTART=Yes, I want to restart my computer now.
NORESTART=No, I will restart my computer later.
ADDITIONALCOMPONENTS_=&Additional Components:
@ -77,13 +78,14 @@ DLG_DISK_SPACE_CHECK_TITLE=Disk space check
DLG_DISK_SPACE_CHECK_CRUTIAL_MSG=Setup has detected insufficient disk space to continue with installation on %s for the path: %sRequired: %sAvailable: %sClick Retry if more disk space has been made available, or click Cancel to cancel Setup.
DLG_DISK_SPACE_CHECK_MSG=Setup has detected insufficient disk space to continue with installation process on %s for the path: %sRequired: %sAvailable: %sClick OK to go back and choose a different destination path.
ERROR_CREATE_DIRECTORY=Could not create folder: %sMake sure you have access to create the folder.
ERROR_MESSAGE_TITLE=$ProductNameInternal$ Setup Error
STR_FILE_NUMBER=File count:
STR_FILENAME=Filename:
MSG_SMARTUPDATE_START=Preparing Install, please wait...
MSG_CONFIGURING=Configuring %s, please wait...
ERROR_XPI_INSTALL=Error occurred during installation
ERROR_SETUP_REQUIREMENT=Windows95 or greater Operating System is required! Exiting setup...
DLG_EXTRACTING_TITLE=Install Progress
DLG_EXTRACTING_TITLE=$ProductName$ Setup - Install Progress
STR_PROCESSINGFILE=Preparing file: %s
STR_INSTALLING=Currently installing %s
STR_COPYINGFILE=Copying file: %s
@ -106,6 +108,7 @@ STR_SAVE_INSTALLER_FILES=Save downloaded and Setup program files to:
MSG_INIT_SETUP=Initializing Setup, please wait...
STR_MESSAGEBOX_TITLE=%s Setup
ERROR_GETVERSION=GetVersionEx() failed!
DLG_USAGE_TITLE=Usage
STATUS_EXTRACTING=Extracting %s
STATUS_LAUNCHING_SETUP=Launching Setup...

View File

@ -48,6 +48,7 @@
#define PP_PATH_ONLY 2
#define PP_ROOT_ONLY 3
#define CLASS_NAME_SETUP "MozillaSetup"
#define CLASS_NAME_SETUP_DLG "MozillaSetupDlg"
char szTitle[MAX_BUF];
@ -965,7 +966,7 @@ RunInstaller()
int APIENTRY
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASS wc;
WNDCLASS wc;
HWND hwndFW;
hInst = hInstance;
@ -979,7 +980,8 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdS
to have its own unique setup directory
*/
if(FindWindow("NSExtracting", "Extracting...") != NULL ||
(hwndFW = FindWindow(CLASS_NAME_SETUP_DLG, NULL)) != NULL)
(hwndFW = FindWindow(CLASS_NAME_SETUP_DLG, NULL)) != NULL ||
(hwndFW = FindWindow(CLASS_NAME_SETUP, NULL)) != NULL)
{
if (gbAllowMultipleInstalls)
{
@ -1002,12 +1004,12 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdS
else
{
if (hwndFW!=NULL)
{
ShowWindow(hwndFW, SW_RESTORE);
SetForegroundWindow(hwndFW);
{
ShowWindow(hwndFW, SW_RESTORE);
SetForegroundWindow(hwndFW);
}
return(1);
}
return(1);
}
}
// Figure out the total size of the resources

View File

@ -41,6 +41,42 @@ static BOOL gbProcessingXpnstallFiles;
static DWORD gdwACFlag;
static DWORD gdwIndexLastSelected;
/* List of Dialog Item IDs from the Download dialog
* that need to be repositioned (up) when the banner
* in the dialog is hidden.
*/
const int DownloadDlgItemList[] = {IDPAUSE,
IDRESUME,
IDCANCEL,
IDC_MESSAGE0,
IDC_STATIC3,
IDC_STATUS_URL,
IDC_STATIC1,
IDC_STATUS_STATUS,
IDC_STATIC2,
IDC_STATUS_FILE,
IDC_GAUGE_FILE,
IDC_PERCENTAGE,
IDC_STATIC4,
IDC_STATUS_TO,
-2}; /* -1 is used by IDC_STATIC. Even though
* there shouldn't be any IDC_STATIC in
* list, we shouldn't use it.
*/
/* List of Dialog Item IDs from the Install Progress dialog
* that need to be repositioned (up) when the banner
* in the dialog is hidden.
*/
const int InstallProgressDlgItemList[] = {IDC_STATUS0,
IDC_GAUGE_ARCHIVE,
IDC_STATUS3,
IDC_GAUGE_FILE,
-2}; /* -1 is used by IDC_STATIC. Even though
* there shouldn't be any IDC_STATIC in
* list, we shouldn't use it.
*/
BOOL AskCancelDlg(HWND hDlg)
{
char szDlgQuitTitle[MAX_BUF];
@ -83,11 +119,136 @@ void DisableSystemMenuItems(HWND hWnd, BOOL bDisableClose)
EnableMenuItem(GetSystemMenu(hWnd, FALSE), SC_CLOSE, MF_BYCOMMAND | MF_GRAYED);
}
/* Function: MoveDlgItem()
*
* in: HWND aWndDlg : handle to a dialog containing items in aIDList.
* const int *aIDList: list of dlg item IDs that require moving.
* DWORD aWidth : width to move the dlg items by (+/-).
* DWORD aHeight : height to move the dlg items by (+/-).
*
* purpose: To move dialog items (given a list of item ids) +aWidth/+aHeight from
* its current position.
* This is for when the banner logo in the download/install process
* dialogs are not to be displayed, it leaves an empty area above
* the dialog items/controls. So this helps move them up by the
* height of the banner.
* The resizing of the window given the lack of the banner is done
* RepositionWindow().
*/
void MoveDlgItem(HWND aWndDlg, const int *aIDList, DWORD aWidth, DWORD aHeight)
{
RECT rect;
HWND hDlgItem;
int i;
int id;
i = 0;
id = aIDList[i];
while(id != -2)
{
hDlgItem = GetDlgItem(aWndDlg, id);
if(hDlgItem)
{
GetWindowRect(hDlgItem, &rect);
SetWindowPos(hDlgItem, NULL, rect.left + aWidth, rect.top + aHeight,
-1, -1, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
}
id = aIDList[++i];
}
}
/* Function: RepositionWindow()
*
* in: HWND aHwndDlg : Window handle to reposition.
* DWORD aBannerImage: Integer indicating which dialog needs to have
* it's dlg items moved.
* There are only 3 types:
* NO_BANNER_IMAGE
* BANNER_IMAGE_DOWNLOAD
* BANNER_IMAGE_INSTALLING
*
* purpose: To reposition a window given the screen position of the previous
* window. The previous window position is saved in:
* gSystemInfo.lastWindowPosCenterX
* gSystemInfo.lastWindowPosCenterY
*
* aHwndDlg is the window handle to the dialog to reposition.
* aBannerImage is a DWORD value that indicates which dialog
* the banner is displayed in. There are only two possible dialogs:
* Download dialog
* Install dialog
*
* This function also hides the banner image normally displayed in
* the Download and Install Process dialgs. Once hidden, it also
* moves all of their dialog items up by the height of the hidden
* banner image and resizes the dialogs so it'll look nice.
*/
void RepositionWindow(HWND aHwndDlg, DWORD aBannerImage)
{
RECT rect;
int iLeft, iTop;
DWORD width = -1;
DWORD height = -1;
DWORD windowFlags = SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE;
GetWindowRect(aHwndDlg, &rect);
if(aBannerImage && !gShowBannerImage)
{
RECT rLogo;
HWND hwndBanner;
hwndBanner = GetDlgItem(aHwndDlg, IDB_BITMAP_BANNER);
GetWindowRect(hwndBanner, &rLogo);
ShowWindow(hwndBanner, SW_HIDE);
width = rect.right;
height = rect.bottom - rLogo.bottom + rLogo.top;
windowFlags = SWP_NOZORDER | SWP_NOACTIVATE;
/* aBannerImage indicates which dialog we need to move it's dlg items
* up to fit the resized window.
*/
switch(aBannerImage)
{
case BANNER_IMAGE_DOWNLOAD:
MoveDlgItem(aHwndDlg, DownloadDlgItemList, 0, -rLogo.bottom);
break;
case BANNER_IMAGE_INSTALLING:
MoveDlgItem(aHwndDlg, InstallProgressDlgItemList, 0, -rLogo.bottom);
break;
default:
break;
}
}
iLeft = (gSystemInfo.lastWindowPosCenterX - ((rect.right - rect.left) / 2));
iTop = (gSystemInfo.lastWindowPosCenterY - ((rect.bottom - rect.top) / 2));
SetWindowPos(aHwndDlg, NULL, iLeft, iTop, width, height, windowFlags);
}
/* Function: SaveWindowPosition()
*
* in: HWND aDlg: Window handle to remember the position of.
*
* purpose: Saves the current window's position so that it can be
* used to position the next window created.
*/
void SaveWindowPosition(HWND aDlg)
{
RECT rectDlg;
if(GetWindowRect(aDlg, &rectDlg))
{
gSystemInfo.lastWindowPosCenterX = ((rectDlg.right - rectDlg.left) / 2) + rectDlg.left;
gSystemInfo.lastWindowPosCenterY = ((rectDlg.bottom - rectDlg.top) / 2) + rectDlg.top;
}
}
LRESULT CALLBACK DlgProcWelcome(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
{
char szBuf[MAX_BUF];
RECT rDlg;
switch(msg)
{
case WM_INITDIALOG:
@ -99,14 +260,7 @@ LRESULT CALLBACK DlgProcWelcome(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
SetDlgItemText(hDlg, IDC_STATIC1, diWelcome.szMessage1);
SetDlgItemText(hDlg, IDC_STATIC2, diWelcome.szMessage2);
if(GetClientRect(hDlg, &rDlg))
SetWindowPos(hDlg,
HWND_TOP,
(gSystemInfo.dwScreenX/2)-(rDlg.right/2),
(gSystemInfo.dwScreenY/2)-(rDlg.bottom/2),
0,
0,
SWP_NOSIZE);
RepositionWindow(hDlg, NO_BANNER_IMAGE);
SetDlgItemText(hDlg, IDWIZNEXT, sgInstallGui.szNext_);
SetDlgItemText(hDlg, IDCANCEL, sgInstallGui.szCancel_);
@ -121,6 +275,7 @@ LRESULT CALLBACK DlgProcWelcome(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
switch(LOWORD(wParam))
{
case IDWIZNEXT:
SaveWindowPosition(hDlg);
DestroyWindow(hDlg);
DlgSequence(NEXT_DLG);
break;
@ -146,7 +301,6 @@ LRESULT CALLBACK DlgProcLicense(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
DWORD dwBytesRead;
HANDLE hFLicense;
FILE *fLicense;
RECT rDlg;
switch(msg)
{
@ -177,14 +331,7 @@ LRESULT CALLBACK DlgProcLicense(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
}
}
if(GetClientRect(hDlg, &rDlg))
SetWindowPos(hDlg,
HWND_TOP,
(gSystemInfo.dwScreenX/2)-(rDlg.right/2),
(gSystemInfo.dwScreenY/2)-(rDlg.bottom/2),
0,
0,
SWP_NOSIZE);
RepositionWindow(hDlg, NO_BANNER_IMAGE);
SetDlgItemText(hDlg, IDWIZBACK, sgInstallGui.szBack_);
SetDlgItemText(hDlg, IDWIZNEXT, sgInstallGui.szAccept_);
@ -201,11 +348,13 @@ LRESULT CALLBACK DlgProcLicense(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
switch(LOWORD(wParam))
{
case IDWIZNEXT:
SaveWindowPosition(hDlg);
DestroyWindow(hDlg);
DlgSequence(NEXT_DLG);
break;
case IDWIZBACK:
SaveWindowPosition(hDlg);
DestroyWindow(hDlg);
DlgSequence(PREV_DLG);
break;
@ -238,7 +387,6 @@ LRESULT CALLBACK BrowseHookProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
{
DWORD dwIndex;
DWORD dwLoop;
RECT rDlg;
char szBuf[MAX_BUF];
char szBufIndex[MAX_BUF];
char szPath[MAX_BUF];
@ -246,18 +394,11 @@ LRESULT CALLBACK BrowseHookProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
switch(message)
{
case WM_INITDIALOG:
case WM_INITDIALOG:
hwndLBFolders = GetDlgItem(hDlg, 1121);
SetDlgItemText(hDlg, IDC_EDIT_DESTINATION, szTempSetupPath);
if(GetClientRect(hDlg, &rDlg))
SetWindowPos(hDlg,
HWND_TOP,
(gSystemInfo.dwScreenX/2)-(rDlg.right/2),
(gSystemInfo.dwScreenY/2)-(rDlg.bottom/2),
0,
0,
SWP_NOSIZE);
RepositionWindow(hDlg, NO_BANNER_IMAGE);
OldListBoxWndProc = SubclassWindow(hwndLBFolders, (WNDPROC)ListBoxBrowseWndProc);
gdwIndexLastSelected = SendDlgItemMessage(hDlg, 1121, LB_GETCURSEL, 0, (LPARAM)0);
@ -313,6 +454,7 @@ LRESULT CALLBACK BrowseHookProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
break;
case IDOK:
SaveWindowPosition(hDlg);
GetDlgItemText(hDlg, IDC_EDIT_DESTINATION, szBuf, MAX_BUF);
if(*szBuf == '\0')
{
@ -348,6 +490,7 @@ LRESULT CALLBACK BrowseHookProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
if(CreateDirectoriesAll(szBuf, ADD_TO_UNINSTALL_LOG) == FALSE)
{
char szECreateDirectory[MAX_BUF];
char szEMessageTitle[MAX_BUF];
lstrcpy(szBufTemp, "\n\n");
lstrcat(szBufTemp, sgProduct.szPath);
@ -357,7 +500,9 @@ LRESULT CALLBACK BrowseHookProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
if(GetPrivateProfileString("Messages", "ERROR_CREATE_DIRECTORY", "", szECreateDirectory, sizeof(szECreateDirectory), szFileIniInstall))
wsprintf(szBuf, szECreateDirectory, szBufTemp);
MessageBox(hDlg, szBuf, "", MB_OK | MB_ICONERROR);
GetPrivateProfileString("Messages", "ERROR_MESSAGE_TITLE", "", szEMessageTitle, sizeof(szEMessageTitle), szFileIniInstall);
MessageBox(hDlg, szBuf, szEMessageTitle, MB_OK | MB_ICONERROR);
break;
}
@ -518,7 +663,6 @@ LRESULT CALLBACK DlgProcSetupType(HWND hDlg, UINT msg, WPARAM wParam, LONG lPara
HWND hStaticSt3;
HWND hReadme;
HWND hDestinationPath;
RECT rDlg;
char szBuf[MAX_BUF];
char szBufTemp[MAX_BUF];
char szBufTemp2[MAX_BUF];
@ -621,14 +765,7 @@ LRESULT CALLBACK DlgProcSetupType(HWND hDlg, UINT msg, WPARAM wParam, LONG lPara
break;
}
if(GetClientRect(hDlg, &rDlg))
SetWindowPos(hDlg,
HWND_TOP,
(gSystemInfo.dwScreenX/2)-(rDlg.right/2),
(gSystemInfo.dwScreenY/2)-(rDlg.bottom/2),
0,
0,
SWP_NOSIZE);
RepositionWindow(hDlg, NO_BANNER_IMAGE);
if((*diSetupType.szReadmeFilename == '\0') || (FileExists(diSetupType.szReadmeFilename) == FALSE))
ShowWindow(hReadme, SW_HIDE);
@ -669,6 +806,7 @@ LRESULT CALLBACK DlgProcSetupType(HWND hDlg, UINT msg, WPARAM wParam, LONG lPara
switch(LOWORD(wParam))
{
case IDC_BUTTON_BROWSE:
SaveWindowPosition(hDlg);
if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST0) == BST_CHECKED)
dwTempSetupType = ST_RADIO0;
else if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST1) == BST_CHECKED)
@ -693,6 +831,7 @@ LRESULT CALLBACK DlgProcSetupType(HWND hDlg, UINT msg, WPARAM wParam, LONG lPara
break;
case IDWIZNEXT:
SaveWindowPosition(hDlg);
lstrcpy(sgProduct.szPath, szTempSetupPath);
/* append a backslash to the path because CreateDirectoriesAll()
@ -722,6 +861,7 @@ LRESULT CALLBACK DlgProcSetupType(HWND hDlg, UINT msg, WPARAM wParam, LONG lPara
if(CreateDirectoriesAll(szBuf, ADD_TO_UNINSTALL_LOG) == FALSE)
{
char szECreateDirectory[MAX_BUF];
char szEMessageTitle[MAX_BUF];
lstrcpy(szBufTemp, "\n\n");
lstrcat(szBufTemp, sgProduct.szPath);
@ -731,7 +871,9 @@ LRESULT CALLBACK DlgProcSetupType(HWND hDlg, UINT msg, WPARAM wParam, LONG lPara
if(GetPrivateProfileString("Messages", "ERROR_CREATE_DIRECTORY", "", szECreateDirectory, sizeof(szECreateDirectory), szFileIniInstall))
wsprintf(szBuf, szECreateDirectory, szBufTemp);
MessageBox(hDlg, szBuf, "", MB_OK | MB_ICONERROR);
GetPrivateProfileString("Messages", "ERROR_MESSAGE_TITLE", "", szEMessageTitle, sizeof(szEMessageTitle), szFileIniInstall);
MessageBox(hDlg, szBuf, szEMessageTitle, MB_OK | MB_ICONERROR);
break;
}
@ -789,6 +931,7 @@ LRESULT CALLBACK DlgProcSetupType(HWND hDlg, UINT msg, WPARAM wParam, LONG lPara
break;
case IDWIZBACK:
SaveWindowPosition(hDlg);
dwTempSetupType = dwSetupType;
lstrcpy(szTempSetupPath, sgProduct.szPath);
DestroyWindow(hDlg);
@ -1072,7 +1215,6 @@ LRESULT CALLBACK DlgProcSelectComponents(HWND hDlg, UINT msg, WPARAM wParam, LON
DWORD dwIndex;
DWORD dwItems = MAX_BUF;
HWND hwndLBComponents;
RECT rDlg;
TCHAR tchBuffer[MAX_BUF];
LPDRAWITEMSTRUCT lpdis;
ULONGLONG ullDSBuf;
@ -1106,14 +1248,7 @@ LRESULT CALLBACK DlgProcSelectComponents(HWND hDlg, UINT msg, WPARAM wParam, LON
SetDlgItemText(hDlg, IDC_STATIC_DESCRIPTION, SiCNodeGetDescriptionLong(0, FALSE, AC_COMPONENTS));
}
if(GetClientRect(hDlg, &rDlg))
SetWindowPos(hDlg,
HWND_TOP,
(gSystemInfo.dwScreenX/2)-(rDlg.right/2),
(gSystemInfo.dwScreenY/2)-(rDlg.bottom/2),
0,
0,
SWP_NOSIZE);
RepositionWindow(hDlg, NO_BANNER_IMAGE);
/* update the disk space available info in the dialog. GetDiskSpaceAvailable()
returns value in kbytes */
@ -1157,7 +1292,7 @@ LRESULT CALLBACK DlgProcSelectComponents(HWND hDlg, UINT msg, WPARAM wParam, LON
if(lpdis->itemID == -1)
break;
DrawLBText(lpdis, AC_COMPONENTS);
DrawLBText(lpdis, AC_COMPONENTS);
DrawCheck(lpdis, AC_COMPONENTS);
// draw the focus rect on the selected item
@ -1189,11 +1324,13 @@ LRESULT CALLBACK DlgProcSelectComponents(HWND hDlg, UINT msg, WPARAM wParam, LON
break;
case IDWIZNEXT:
SaveWindowPosition(hDlg);
DestroyWindow(hDlg);
DlgSequence(NEXT_DLG);
break;
case IDWIZBACK:
SaveWindowPosition(hDlg);
DestroyWindow(hDlg);
DlgSequence(PREV_DLG);
break;
@ -1218,7 +1355,6 @@ LRESULT CALLBACK DlgProcSelectAdditionalComponents(HWND hDlg, UINT msg, WPARAM w
DWORD dwIndex;
DWORD dwItems = MAX_BUF;
HWND hwndLBComponents;
RECT rDlg;
TCHAR tchBuffer[MAX_BUF];
LPDRAWITEMSTRUCT lpdis;
ULONGLONG ullDSBuf;
@ -1252,14 +1388,7 @@ LRESULT CALLBACK DlgProcSelectAdditionalComponents(HWND hDlg, UINT msg, WPARAM w
SetDlgItemText(hDlg, IDC_STATIC_DESCRIPTION, SiCNodeGetDescriptionLong(0, FALSE, AC_ADDITIONAL_COMPONENTS));
}
if(GetClientRect(hDlg, &rDlg))
SetWindowPos(hDlg,
HWND_TOP,
(gSystemInfo.dwScreenX/2)-(rDlg.right/2),
(gSystemInfo.dwScreenY/2)-(rDlg.bottom/2),
0,
0,
SWP_NOSIZE);
RepositionWindow(hDlg, NO_BANNER_IMAGE);
/* update the disk space available info in the dialog. GetDiskSpaceAvailable()
returns value in kbytes */
@ -1335,11 +1464,13 @@ LRESULT CALLBACK DlgProcSelectAdditionalComponents(HWND hDlg, UINT msg, WPARAM w
break;
case IDWIZNEXT:
SaveWindowPosition(hDlg);
DestroyWindow(hDlg);
DlgSequence(NEXT_DLG);
break;
case IDWIZBACK:
SaveWindowPosition(hDlg);
DestroyWindow(hDlg);
DlgSequence(PREV_DLG);
break;
@ -1363,7 +1494,6 @@ LRESULT CALLBACK DlgProcWindowsIntegration(HWND hDlg, UINT msg, WPARAM wParam, L
HWND hcbCheck1;
HWND hcbCheck2;
HWND hcbCheck3;
RECT rDlg;
hcbCheck0 = GetDlgItem(hDlg, IDC_CHECK0);
hcbCheck1 = GetDlgItem(hDlg, IDC_CHECK1);
@ -1414,14 +1544,7 @@ LRESULT CALLBACK DlgProcWindowsIntegration(HWND hDlg, UINT msg, WPARAM wParam, L
else
ShowWindow(hcbCheck3, SW_HIDE);
if(GetClientRect(hDlg, &rDlg))
SetWindowPos(hDlg,
HWND_TOP,
(gSystemInfo.dwScreenX/2)-(rDlg.right/2),
(gSystemInfo.dwScreenY/2)-(rDlg.bottom/2),
0,
0,
SWP_NOSIZE);
RepositionWindow(hDlg, NO_BANNER_IMAGE);
SetDlgItemText(hDlg, IDWIZBACK, sgInstallGui.szBack_);
SetDlgItemText(hDlg, IDWIZNEXT, sgInstallGui.szNext_);
@ -1441,6 +1564,7 @@ LRESULT CALLBACK DlgProcWindowsIntegration(HWND hDlg, UINT msg, WPARAM wParam, L
switch(LOWORD(wParam))
{
case IDWIZNEXT:
SaveWindowPosition(hDlg);
if(IsDlgButtonChecked(hDlg, IDC_CHECK0) == BST_CHECKED)
{
}
@ -1482,6 +1606,7 @@ LRESULT CALLBACK DlgProcWindowsIntegration(HWND hDlg, UINT msg, WPARAM wParam, L
break;
case IDWIZBACK:
SaveWindowPosition(hDlg);
DestroyWindow(hDlg);
DlgSequence(PREV_DLG);
break;
@ -1504,7 +1629,6 @@ LRESULT CALLBACK DlgProcProgramFolder(HWND hDlg, UINT msg, WPARAM wParam, LONG l
HANDLE hDir;
DWORD dwIndex;
WIN32_FIND_DATA wfdFindFileData;
RECT rDlg;
switch(msg)
{
@ -1531,14 +1655,7 @@ LRESULT CALLBACK DlgProcProgramFolder(HWND hDlg, UINT msg, WPARAM wParam, LONG l
FindClose(hDir);
}
if(GetClientRect(hDlg, &rDlg))
SetWindowPos(hDlg,
HWND_TOP,
(gSystemInfo.dwScreenX/2)-(rDlg.right/2),
(gSystemInfo.dwScreenY/2)-(rDlg.bottom/2),
0,
0,
SWP_NOSIZE);
RepositionWindow(hDlg, NO_BANNER_IMAGE);
SetDlgItemText(hDlg, IDC_STATIC1, sgInstallGui.szProgramFolder_);
SetDlgItemText(hDlg, IDC_STATIC2, sgInstallGui.szExistingFolder_);
@ -1559,6 +1676,7 @@ LRESULT CALLBACK DlgProcProgramFolder(HWND hDlg, UINT msg, WPARAM wParam, LONG l
switch(LOWORD(wParam))
{
case IDWIZNEXT:
SaveWindowPosition(hDlg);
GetDlgItemText(hDlg, IDC_EDIT_PROGRAM_FOLDER, szBuf, MAX_BUF);
if(*szBuf == '\0')
{
@ -1575,6 +1693,7 @@ LRESULT CALLBACK DlgProcProgramFolder(HWND hDlg, UINT msg, WPARAM wParam, LONG l
break;
case IDWIZBACK:
SaveWindowPosition(hDlg);
DestroyWindow(hDlg);
DlgSequence(PREV_DLG);
break;
@ -1609,7 +1728,6 @@ void SaveDownloadProtocolOption(HWND hDlg)
LRESULT CALLBACK DlgProcAdvancedSettings(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
{
RECT rDlg;
char szBuf[MAX_BUF];
switch(msg)
@ -1623,14 +1741,7 @@ LRESULT CALLBACK DlgProcAdvancedSettings(HWND hDlg, UINT msg, WPARAM wParam, LON
SetDlgItemText(hDlg, IDC_EDIT_PROXY_USER, diAdvancedSettings.szProxyUser);
SetDlgItemText(hDlg, IDC_EDIT_PROXY_PASSWD, diAdvancedSettings.szProxyPasswd);
if(GetClientRect(hDlg, &rDlg))
SetWindowPos(hDlg,
HWND_TOP,
(gSystemInfo.dwScreenX/2)-(rDlg.right/2),
(gSystemInfo.dwScreenY/2)-(rDlg.bottom/2),
0,
0,
SWP_NOSIZE);
RepositionWindow(hDlg, NO_BANNER_IMAGE);
GetPrivateProfileString("Strings", "IDC Use Ftp", "", szBuf, sizeof(szBuf), szFileIniConfig);
SetDlgItemText(hDlg, IDC_USE_FTP, szBuf);
@ -1691,6 +1802,7 @@ LRESULT CALLBACK DlgProcAdvancedSettings(HWND hDlg, UINT msg, WPARAM wParam, LON
switch(LOWORD(wParam))
{
case IDWIZNEXT:
SaveWindowPosition(hDlg);
/* get the proxy server and port information */
GetDlgItemText(hDlg, IDC_EDIT_PROXY_SERVER, diAdvancedSettings.szProxyServer, MAX_BUF);
GetDlgItemText(hDlg, IDC_EDIT_PROXY_PORT, diAdvancedSettings.szProxyPort, MAX_BUF);
@ -1704,6 +1816,7 @@ LRESULT CALLBACK DlgProcAdvancedSettings(HWND hDlg, UINT msg, WPARAM wParam, LON
case IDWIZBACK:
case IDCANCEL:
SaveWindowPosition(hDlg);
DestroyWindow(hDlg);
DlgSequence(PREV_DLG);
break;
@ -1739,7 +1852,6 @@ void SaveAdditionalOptions(HWND hDlg, HWND hwndCBSiteSelector)
LRESULT CALLBACK DlgProcAdditionalOptions(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
{
RECT rDlg;
char szBuf[MAX_BUF];
HWND hwndCBSiteSelector;
int iIndex;
@ -1764,7 +1876,7 @@ LRESULT CALLBACK DlgProcAdditionalOptions(HWND hDlg, UINT msg, WPARAM wParam, LO
}
if(GetTotalArchivesToDownload() == 0)
{
{
ShowWindow(GetDlgItem(hDlg, IDC_MESSAGE1), SW_HIDE);
ShowWindow(GetDlgItem(hDlg, IDC_CHECK_SAVE_INSTALLER_FILES), SW_HIDE);
ShowWindow(GetDlgItem(hDlg, IDC_EDIT_LOCAL_INSTALLER_PATH), SW_HIDE);
@ -1799,14 +1911,7 @@ LRESULT CALLBACK DlgProcAdditionalOptions(HWND hDlg, UINT msg, WPARAM wParam, LO
SendDlgItemMessage (hDlg, IDC_CHECK_RECAPTURE_HOMEPAGE, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);
SendDlgItemMessage (hDlg, IDC_EDIT_LOCAL_INSTALLER_PATH, WM_SETFONT, (WPARAM)sgInstallGui.systemFont, 0L);
if(GetClientRect(hDlg, &rDlg))
SetWindowPos(hDlg,
HWND_TOP,
(gSystemInfo.dwScreenX/2)-(rDlg.right/2),
(gSystemInfo.dwScreenY/2)-(rDlg.bottom/2),
0,
0,
SWP_NOSIZE);
RepositionWindow(hDlg, NO_BANNER_IMAGE);
ssiTemp = ssiSiteSelector;
do
@ -1847,18 +1952,21 @@ LRESULT CALLBACK DlgProcAdditionalOptions(HWND hDlg, UINT msg, WPARAM wParam, LO
switch(LOWORD(wParam))
{
case IDWIZNEXT:
SaveWindowPosition(hDlg);
SaveAdditionalOptions(hDlg, hwndCBSiteSelector);
DestroyWindow(hDlg);
DlgSequence(NEXT_DLG);
break;
case IDWIZBACK:
SaveWindowPosition(hDlg);
SaveAdditionalOptions(hDlg, hwndCBSiteSelector);
DestroyWindow(hDlg);
DlgSequence(PREV_DLG);
break;
case IDC_BUTTON_ADDITIONAL_SETTINGS:
SaveWindowPosition(hDlg);
SaveAdditionalOptions(hDlg, hwndCBSiteSelector);
DestroyWindow(hDlg);
DlgSequence(OTHER_DLG_1);
@ -2147,7 +2255,6 @@ LPSTR GetStartInstallMessage()
LRESULT CALLBACK DlgProcQuickLaunch(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
{
RECT rDlg;
LPSTR szMessage = NULL;
char szBuf[MAX_BUF];
@ -2172,20 +2279,11 @@ LRESULT CALLBACK DlgProcQuickLaunch(HWND hDlg, UINT msg, WPARAM wParam, LONG lPa
SendDlgItemMessage (hDlg, IDC_MESSAGE2, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);
SendDlgItemMessage (hDlg, IDC_CHECK_TURBO_MODE, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);
if(GetClientRect(hDlg, &rDlg))
SetWindowPos(hDlg,
HWND_TOP,
(gSystemInfo.dwScreenX/2)-(rDlg.right/2),
(gSystemInfo.dwScreenY/2)-(rDlg.bottom/2),
0,
0,
SWP_NOSIZE);
RepositionWindow(hDlg, NO_BANNER_IMAGE);
{
SetDlgItemText(hDlg, IDC_MESSAGE0, diQuickLaunch.szMessage0);
SetDlgItemText(hDlg, IDC_MESSAGE1, diQuickLaunch.szMessage1);
SetDlgItemText(hDlg, IDC_MESSAGE2, diQuickLaunch.szMessage2);
}
SetDlgItemText(hDlg, IDC_MESSAGE0, diQuickLaunch.szMessage0);
SetDlgItemText(hDlg, IDC_MESSAGE1, diQuickLaunch.szMessage1);
SetDlgItemText(hDlg, IDC_MESSAGE2, diQuickLaunch.szMessage2);
if(diQuickLaunch.bTurboModeEnabled)
ShowWindow(GetDlgItem(hDlg, IDC_CHECK_TURBO_MODE), SW_SHOW);
@ -2206,6 +2304,7 @@ LRESULT CALLBACK DlgProcQuickLaunch(HWND hDlg, UINT msg, WPARAM wParam, LONG lPa
switch(LOWORD(wParam))
{
case IDWIZNEXT:
SaveWindowPosition(hDlg);
if(diQuickLaunch.bTurboModeEnabled)
{
if(IsDlgButtonChecked(hDlg, IDC_CHECK_TURBO_MODE) == BST_CHECKED)
@ -2219,6 +2318,7 @@ LRESULT CALLBACK DlgProcQuickLaunch(HWND hDlg, UINT msg, WPARAM wParam, LONG lPa
break;
case IDWIZBACK:
SaveWindowPosition(hDlg);
/* remember the last state of the TurboMode checkbox */
if(IsDlgButtonChecked(hDlg, IDC_CHECK_TURBO_MODE) == BST_CHECKED) {
diQuickLaunch.bTurboMode = TRUE;
@ -2244,7 +2344,6 @@ LRESULT CALLBACK DlgProcQuickLaunch(HWND hDlg, UINT msg, WPARAM wParam, LONG lPa
LRESULT CALLBACK DlgProcStartInstall(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
{
RECT rDlg;
LPSTR szMessage = NULL;
switch(msg)
@ -2264,14 +2363,7 @@ LRESULT CALLBACK DlgProcStartInstall(HWND hDlg, UINT msg, WPARAM wParam, LONG lP
SendDlgItemMessage (hDlg, IDC_MESSAGE0, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);
SendDlgItemMessage (hDlg, IDC_CURRENT_SETTINGS, WM_SETFONT, (WPARAM)sgInstallGui.systemFont, 0L);
if(GetClientRect(hDlg, &rDlg))
SetWindowPos(hDlg,
HWND_TOP,
(gSystemInfo.dwScreenX/2)-(rDlg.right/2),
(gSystemInfo.dwScreenY/2)-(rDlg.bottom/2),
0,
0,
SWP_NOSIZE);
RepositionWindow(hDlg, NO_BANNER_IMAGE);
if((diAdvancedSettings.bShowDialog == FALSE) || (GetTotalArchivesToDownload() == 0))
{
@ -2296,11 +2388,13 @@ LRESULT CALLBACK DlgProcStartInstall(HWND hDlg, UINT msg, WPARAM wParam, LONG lP
switch(LOWORD(wParam))
{
case IDWIZNEXT:
SaveWindowPosition(hDlg);
DestroyWindow(hDlg);
DlgSequence(NEXT_DLG);
break;
case IDWIZBACK:
SaveWindowPosition(hDlg);
DestroyWindow(hDlg);
DlgSequence(PREV_DLG);
break;
@ -2322,7 +2416,6 @@ LRESULT CALLBACK DlgProcReboot(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
HANDLE hToken;
TOKEN_PRIVILEGES tkp;
HWND hRadioYes;
RECT rDlg;
hRadioYes = GetDlgItem(hDlg, IDC_RADIO_YES);
@ -2333,15 +2426,9 @@ LRESULT CALLBACK DlgProcReboot(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
CheckDlgButton(hDlg, IDC_RADIO_YES, BST_CHECKED);
SetFocus(hRadioYes);
if(GetClientRect(hDlg, &rDlg))
SetWindowPos(hDlg,
HWND_TOP,
(gSystemInfo.dwScreenX/2)-(rDlg.right/2),
(gSystemInfo.dwScreenY/2)-(rDlg.bottom/2),
0,
0,
SWP_NOSIZE);
RepositionWindow(hDlg, NO_BANNER_IMAGE);
SetWindowText(hDlg, sgInstallGui.szRestart);
SetDlgItemText(hDlg, 202, sgInstallGui.szSetupMessage);
SetDlgItemText(hDlg, IDC_RADIO_YES, sgInstallGui.szYesRestart);
SetDlgItemText(hDlg, IDC_RADIO_NO, sgInstallGui.szNoRestart);
@ -2353,6 +2440,7 @@ LRESULT CALLBACK DlgProcReboot(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
break;
case WM_COMMAND:
SaveWindowPosition(hDlg);
switch(LOWORD(wParam))
{
case IDOK:
@ -2425,21 +2513,14 @@ LRESULT CALLBACK DlgProcMessage(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
lstrcpy(szBuf, sgProduct.szProductName);
SetWindowText(hDlg, szBuf);
if(GetClientRect(hDlg, &rDlg))
SetWindowPos(hDlg,
HWND_TOP,
(gSystemInfo.dwScreenX/2)-(rDlg.right/2),
(gSystemInfo.dwScreenY/2)-(rDlg.bottom/2),
0,
0,
SWP_NOSIZE);
RepositionWindow(hDlg, NO_BANNER_IMAGE);
break;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_MESSAGE:
SaveWindowPosition(hDlg);
hdcSTMessage = GetWindowDC(hSTMessage);
SystemParametersInfo(SPI_GETICONTITLELOGFONT,
@ -2456,12 +2537,12 @@ LRESULT CALLBACK DlgProcMessage(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
DeleteObject(hfontTmp);
ReleaseDC(hSTMessage, hdcSTMessage);
SetWindowPos(hDlg, HWND_TOP,
(gSystemInfo.dwScreenX/2)-((sizeString.cx + 55)/2),
(gSystemInfo.dwScreenY/2)-((sizeString.cy + 50)/2),
SetWindowPos(hDlg, NULL,
(gSystemInfo.lastWindowPosCenterX)-((sizeString.cx + 55)/2),
(gSystemInfo.lastWindowPosCenterY)-((sizeString.cy + 50)/2),
sizeString.cx + 55,
sizeString.cy + 50,
SWP_SHOWWINDOW);
SWP_SHOWWINDOW|SWP_NOZORDER);
if(GetClientRect(hDlg, &rDlg))
SetWindowPos(hSTMessage,
@ -2470,7 +2551,7 @@ LRESULT CALLBACK DlgProcMessage(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
rDlg.top,
rDlg.right,
rDlg.bottom,
SWP_SHOWWINDOW);
SWP_SHOWWINDOW|SWP_NOZORDER);
SetDlgItemText(hDlg, IDC_MESSAGE, (LPSTR)lParam);
break;
@ -2495,9 +2576,12 @@ void ShowMessage(LPSTR szMessage, BOOL bShow)
{
char szBuf[MAX_BUF];
if(!hDlgMessage ||!szMessage)
return;
if(sgProduct.mode != SILENT)
{
if((bShow) && (hDlgMessage == NULL))
if(bShow)
{
ZeroMemory(szBuf, sizeof(szBuf));
GetPrivateProfileString("Messages", "MB_MESSAGE_STR", "", szBuf, sizeof(szBuf), szFileIniInstall);
@ -2505,8 +2589,9 @@ void ShowMessage(LPSTR szMessage, BOOL bShow)
SendMessage(hDlgMessage, WM_COMMAND, IDC_MESSAGE, (LPARAM)szMessage);
SendDlgItemMessage (hDlgMessage, IDC_MESSAGE, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);
}
else if(!bShow && hDlgMessage)
else
{
SaveWindowPosition(hDlgMessage);
DestroyWindow(hDlgMessage);
hDlgMessage = NULL;
}

View File

@ -64,6 +64,8 @@ WNDPROC SubclassWindow( HWND hWnd, WNDPROC NewWndProc);
LRESULT CALLBACK ListBoxBrowseWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
void DisableSystemMenuItems(HWND hWnd, BOOL bDisableClose);
void CommitInstall(void);
void RepositionWindow(HWND aHwndDlg, DWORD aBannerImage);
void SaveWindowPosition(HWND aDlg);
#endif /* _DIALOGS_H_ */

View File

@ -78,6 +78,7 @@ extern BOOL gbDownloadTriggered;
extern BOOL gbAllowMultipleInstalls;
extern BOOL gbForceInstall;
extern BOOL gbForceInstallGre;
extern BOOL gShowBannerImage;
extern setupGen sgProduct;
extern diS diSetup;

View File

@ -101,15 +101,60 @@ BOOL InitDialogClass(HINSTANCE hInstance, HINSTANCE hSetupRscInst)
BOOL InitApplication(HINSTANCE hInstance, HINSTANCE hSetupRscInst)
{
BOOL bRv;
WNDCLASS wc;
wc.style = CS_HREDRAW | CS_VREDRAW | CS_PARENTDC | CS_SAVEBITS;
wc.lpfnWndProc = DefWindowProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(hSetupRscInst, MAKEINTRESOURCE(IDI_SETUP));
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_ACTIVECAPTION + 1);
wc.lpszMenuName = NULL;
wc.lpszClassName = CLASS_NAME_SETUP;
bRv = RegisterClass(&wc);
if(bRv == FALSE)
return(bRv);
return(InitDialogClass(hInstance, hSetupRscInst));
}
BOOL InitInstance(HINSTANCE hInstance, DWORD dwCmdShow)
{
HWND hWnd;
gSystemInfo.dwScreenX = GetSystemMetrics(SM_CXSCREEN);
gSystemInfo.dwScreenY = GetSystemMetrics(SM_CYSCREEN);
gSystemInfo.lastWindowPosCenterX = gSystemInfo.dwScreenX / 2;
gSystemInfo.lastWindowPosCenterY = gSystemInfo.dwScreenY / 2;
hInst = hInstance;
/* This window is only for the purpose of allowing the self-extracting .exe
* code to detect that a setup.exe is currenly running and do the appropriate
* action given certain conditions. This window is created and left in the
* invisible state.
* There's no other purpose for this window at this time.
*/
hWnd = CreateWindow(CLASS_NAME_SETUP,
DEFAULT_SETUP_WINDOW_NAME,
WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
-150,
-50,
1,
1,
NULL,
NULL,
hInstance,
NULL);
if(!hWnd)
return(FALSE);
hWndMain = NULL;
return(TRUE);
@ -5342,6 +5387,47 @@ void ResolveDependees(LPSTR szToggledReferenceName, HWND hwndListBox)
ResolveDependees(szToggledReferenceName, hwndListBox);
}
/* Function: ReplacePrivateProfileStrCR()
*
* in: LPSTR aInputOutputStr: In/out string to containing "\\n" to replace.
*
* purpose: To parse for and replace "\\n" string with "\n". Strings stored
* in .ini files cannot contain "\n" because it's a key delimiter.
* To work around this limination, "\\n" chars can be used to
* represent '\n'. This function will look for "\\n" and replace
* them with a true "\n".
* If it encounters a string of "\\\\n" (which looks like '\\n'),
* then this function will strip out the extra '\\' and just show
* "\\n";
*/
void ReplacePrivateProfileStrCR(LPSTR aInputOutputStr)
{
LPSTR pSearch = aInputOutputStr;
LPSTR pSearchEnd = aInputOutputStr + lstrlen(aInputOutputStr);
LPSTR pPreviousSearch = NULL;
while (pSearch < pSearchEnd)
{
if (('\\' == *pSearch) || ('n' == *pSearch))
{
// found a '\\' or 'n'. check to see if the prefivous char is also a '\\'.
if (pPreviousSearch && ('\\' == *pPreviousSearch))
{
if ('n' == *pSearch)
*pSearch = '\n';
memmove(pPreviousSearch, pSearch, pSearchEnd-pSearch+1);
// our string is shorter now ...
pSearchEnd -= pSearch - pPreviousSearch;
}
}
pPreviousSearch = pSearch;
pSearch = CharNext(pSearch);
}
}
void PrintUsage(void)
{
char szBuf[MAX_BUF];
@ -5356,6 +5442,7 @@ void PrintUsage(void)
* -greLocal: Forces GRE to be installed into the application dir.
* -greShared: Forces GRE to be installed into a global, shared dir (normally
* c:\program files\common files\mozilla.org\GRE
* -reg_path [path]: Where to make entries in the Windows registry. (Shared installs)
* -f: Force install of GRE installer (Shared installs), though it'll work
* for non GRE installers too.
* -greForce: Force 'Component GRE' to be downloaded, run, and installed. This
@ -5364,11 +5451,14 @@ void PrintUsage(void)
* -n [filename]: setup's parent's process filename
* -ma: run setup in Auto mode
* -mmi: Allow multiple installer instances. (Shared installs)
* -showBanner: Show the banner in the download and install process dialogs.
* This will override config.ini
* -hideBanner: Hides the banner in the download and install process dialogs.
* This will override config.ini
* -ms: run setup in Silent mode
* -ira: ignore the [RunAppX] sections
* -ispf: ignore the [Program FolderX] sections that show
* the Start Menu shortcut folder at the end of installation.
* -reg_path [path]: Where to make entries in the Windows registry. (Shared installs)
*/
if(sgProduct.szParentProcessFilename && *sgProduct.szParentProcessFilename != '\0')
@ -5382,12 +5472,74 @@ void PrintUsage(void)
GetPrivateProfileString("Strings", "UsageMsg Usage", "", szBuf, sizeof(szBuf), szFileIniConfig);
if (lstrlen(szBuf) > 0)
{
wsprintf(szUsageMsg, szBuf, szProcessFilename, "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n");
PrintError(szUsageMsg, ERROR_CODE_HIDE);
char strUsage[MAX_BUF];
ReplacePrivateProfileStrCR(szBuf);
_snprintf(szUsageMsg, sizeof(szUsageMsg), szBuf, szProcessFilename);
GetPrivateProfileString("Messages", "DLG_USAGE_TITLE", "", strUsage, sizeof(strUsage), szFileIniInstall);
MessageBox(hWndMain, szUsageMsg, strUsage, MB_ICONEXCLAMATION);
}
}
DWORD ParseCommandLine(LPSTR lpszCmdLine)
/* Function: ParseForStartupOptions()
* in: aCmdLine
* purpose: Parses for options that affect the initialization of setup.exe,
* such as -ms, -ma, -mmi.
* This is required to be parsed this early because setup needs to
* know if dialogs need to be shown (-ms, -ma) and also where to
* create the temp directory for temporary items to be placed at
* (-mmi).
*/
DWORD ParseForStartupOptions(LPSTR aCmdLine)
{
char szArgVBuf[MAX_BUF];
int i;
int iArgC;
#ifdef XXX_DEBUG
char szBuf[MAX_BUF];
char szOutputStr[MAX_BUF];
#endif
iArgC = GetArgC(aCmdLine);
#ifdef XXX_DEBUG
wsprintf(szOutputStr, "ArgC: %d\n", iArgC);
#endif
i = 0;
while(i < iArgC)
{
GetArgV(aCmdLine, i, szArgVBuf, sizeof(szArgVBuf));
if(!lstrcmpi(szArgVBuf, "-mmi") || !lstrcmpi(szArgVBuf, "/mmi"))
{
gbAllowMultipleInstalls = TRUE;
}
else if(!lstrcmpi(szArgVBuf, "-ma") || !lstrcmpi(szArgVBuf, "/ma"))
SetSetupRunMode("AUTO");
else if(!lstrcmpi(szArgVBuf, "-ms") || !lstrcmpi(szArgVBuf, "/ms"))
SetSetupRunMode("SILENT");
#ifdef XXX_DEBUG
itoa(i, szBuf, 10);
lstrcat(szOutputStr, " ");
lstrcat(szOutputStr, szBuf);
lstrcat(szOutputStr, ": ");
lstrcat(szOutputStr, szArgVBuf);
lstrcat(szOutputStr, "\n");
#endif
++i;
}
#ifdef XXX_DEBUG
MessageBox(NULL, szOutputStr, "Output", MB_OK);
#endif
return(WIZ_OK);
}
DWORD ParseCommandLine(LPSTR aMessageToClose, LPSTR lpszCmdLine)
{
char szArgVBuf[MAX_BUF];
int i;
@ -5411,6 +5563,7 @@ DWORD ParseCommandLine(LPSTR lpszCmdLine)
if(!lstrcmpi(szArgVBuf, "-h") || !lstrcmpi(szArgVBuf, "/h"))
{
ShowMessage(aMessageToClose, FALSE);
PrintUsage();
return(WIZ_ERROR_UNDEFINED);
}
@ -5442,10 +5595,6 @@ DWORD ParseCommandLine(LPSTR lpszCmdLine)
GetArgV(lpszCmdLine, i, szArgVBuf, sizeof(szArgVBuf));
lstrcpy(sgProduct.szParentProcessFilename, szArgVBuf);
}
else if(!lstrcmpi(szArgVBuf, "-ma") || !lstrcmpi(szArgVBuf, "/ma"))
SetSetupRunMode("AUTO");
else if(!lstrcmpi(szArgVBuf, "-ms") || !lstrcmpi(szArgVBuf, "/ms"))
SetSetupRunMode("SILENT");
else if(!lstrcmpi(szArgVBuf, "-ira") || !lstrcmpi(szArgVBuf, "/ira"))
/* ignore [RunAppX] sections */
gbIgnoreRunAppX = TRUE;
@ -5480,9 +5629,13 @@ DWORD ParseCommandLine(LPSTR lpszCmdLine)
GetArgV(lpszCmdLine, i, szArgVBuf, sizeof(szArgVBuf));
lstrcpy(sgProduct.szRegPath, szArgVBuf);
}
else if(!lstrcmpi(szArgVBuf, "-mmi") || !lstrcmpi(szArgVBuf, "/mmi"))
else if(!lstrcmpi(szArgVBuf, "-showBanner") || !lstrcmpi(szArgVBuf, "/showBanner"))
{
gbAllowMultipleInstalls = TRUE;
gShowBannerImage = TRUE;
}
else if(!lstrcmpi(szArgVBuf, "-hideBanner") || !lstrcmpi(szArgVBuf, "/hideBanner"))
{
gShowBannerImage = FALSE;
}
#ifdef XXX_DEBUG
@ -6172,12 +6325,8 @@ HRESULT ParseConfigIni(LPSTR lpszCmdLine)
/* get main install path */
if(LocatePreviousPath("Locate Previous Product Path", szPreviousPath, sizeof(szPreviousPath)) == FALSE)
{
// If the path was set on the command-line than we don't want to use the default here.
if(*sgProduct.szPath == '\0')
{
GetPrivateProfileString("General", "Path", "", szBuf, sizeof(szBuf), szFileIniConfig);
DecryptString(sgProduct.szPath, szBuf);
}
GetPrivateProfileString("General", "Path", "", szBuf, sizeof(szBuf), szFileIniConfig);
DecryptString(sgProduct.szPath, szBuf);
}
else
{
@ -6275,11 +6424,15 @@ HRESULT ParseConfigIni(LPSTR lpszCmdLine)
GetPrivateProfileString("General", "GRE Private Key", "", szBuf, sizeof(szBuf), szFileIniConfig);
if(*szBuf != '\0')
{
DecryptString(sgProduct.grePrivateKey, szBuf);
lstrcat(sgProduct.grePrivateKey, "_");
lstrcat(sgProduct.grePrivateKey, sgProduct.szProductNameInternal);
}
GetPrivateProfileString("General", "Show Banner Image", "", szBuf, sizeof(szBuf), szFileIniConfig);
if(lstrcmpi(szBuf, "FALSE") == 0)
gShowBannerImage = FALSE;
iRv = ParseCommandLine(szMsgInitSetup, lpszCmdLine);
if(iRv)
return(iRv);
/* Welcome dialog */
GetPrivateProfileString("Dialog Welcome", "Show Dialog", "", szShowDialog, sizeof(szShowDialog), szFileIniConfig);
@ -6629,7 +6782,7 @@ HRESULT ParseConfigIni(LPSTR lpszCmdLine)
wsprintf(szTitle, szBuf, sgProduct.szProductName);
GetPrivateProfileString("Strings", "Message Unfinished Download Restart", "", szBuf, sizeof(szBuf), szFileIniConfig);
if(MessageBox(hWndMain, szBuf, szTitle, MB_YESNO | MB_ICONQUESTION) == IDNO)
if(MessageBox(hWndMain, szBuf, szTitle, MB_YESNO | MB_ICONQUESTION | MB_SETFOREGROUND) == IDNO)
{
UnsetSetupCurrentDownloadFile();
UnsetSetupState(); /* unset the download state so that the archives can be deleted */
@ -6656,7 +6809,7 @@ HRESULT ParseConfigIni(LPSTR lpszCmdLine)
wsprintf(szTitle, szBuf, sgProduct.szProductName);
GetPrivateProfileString("Strings", "Message Unfinished Install Xpi Restart", "", szBuf, sizeof(szBuf), szFileIniConfig);
if(MessageBox(hWndMain, szBuf, szTitle, MB_YESNO | MB_ICONQUESTION) == IDNO)
if(MessageBox(hWndMain, szBuf, szTitle, MB_YESNO | MB_ICONQUESTION | MB_SETFOREGROUND) == IDNO)
{
UnsetSetupCurrentDownloadFile();
UnsetSetupState(); /* unset the installing xpis state so that the archives can be deleted */
@ -6718,6 +6871,7 @@ HRESULT ParseInstallIni()
GetPrivateProfileString("General", "PROGRAMFOLDER_", "", sgInstallGui.szProgramFolder_, sizeof(sgInstallGui.szProgramFolder_), szFileIniInstall);
GetPrivateProfileString("General", "EXISTINGFOLDERS_", "", sgInstallGui.szExistingFolder_, sizeof(sgInstallGui.szExistingFolder_), szFileIniInstall);
GetPrivateProfileString("General", "SETUPMESSAGE", "", sgInstallGui.szSetupMessage, sizeof(sgInstallGui.szSetupMessage), szFileIniInstall);
GetPrivateProfileString("General", "RESTART", "", sgInstallGui.szRestart, sizeof(sgInstallGui.szRestart), szFileIniInstall);
GetPrivateProfileString("General", "YESRESTART", "", sgInstallGui.szYesRestart, sizeof(sgInstallGui.szYesRestart), szFileIniInstall);
GetPrivateProfileString("General", "NORESTART", "", sgInstallGui.szNoRestart, sizeof(sgInstallGui.szNoRestart), szFileIniInstall);
GetPrivateProfileString("General", "ADDITIONALCOMPONENTS_", "", sgInstallGui.szAdditionalComponents_, sizeof(sgInstallGui.szAdditionalComponents_), szFileIniInstall);

View File

@ -169,7 +169,8 @@ LPSTR GetArgV(LPSTR lpszCommandLine,
int iIndex,
LPSTR lpszDest,
int iDestSize);
DWORD ParseCommandLine(LPSTR lpszCmdLine);
DWORD ParseCommandLine(LPSTR aMessageToClose, LPSTR lpszCmdLine);
DWORD ParseForStartupOptions(LPSTR aCmdLine);
void SetSetupRunMode(LPSTR szMode);
void Delay(DWORD dwSeconds);
void UnsetSetupState(void);
@ -224,6 +225,7 @@ HRESULT ProcessXpinstallEngine(void);
void GetXpinstallPath(char *aPath, int aPathBufSize);
int AddGrePathToApplicationAppPathsKey(void);
BOOL GreInstallerNeedsReboot(void);
void ReplacePrivateProfileStrCR(LPSTR aInputOutputStr);
#endif /* _EXTRA_H_ */

View File

@ -60,8 +60,6 @@ LPSTR szSiteSelectorDescription;
DWORD dwWizardState;
DWORD dwSetupType;
DWORD dwScreenX;
DWORD dwScreenY;
DWORD dwTempSetupType;
DWORD gdwUpgradeValue;
@ -84,6 +82,7 @@ BOOL gbForceInstall = FALSE;
* GRE is appropriately versioned. See bug 180383
*/
BOOL gbForceInstallGre = TRUE;
BOOL gShowBannerImage = TRUE;
setupGen sgProduct;
diS diSetup;
@ -137,9 +136,11 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmd
{
if(InitSetupGeneral())
PostQuitMessage(1);
else if(ParseCommandLine(lpszCmdLine))
else if(ParseForStartupOptions(lpszCmdLine))
PostQuitMessage(1);
else if((hwndFW = FindWindow(CLASS_NAME_SETUP_DLG, NULL)) != NULL && !gbAllowMultipleInstalls)
else if(((hwndFW = FindWindow(CLASS_NAME_SETUP_DLG, NULL)) != NULL ||
((hwndFW = FindWindow(CLASS_NAME_SETUP, NULL)) != NULL)) &&
!gbAllowMultipleInstalls)
{
/* Allow only one instance of setup to run.
* Detect a previous instance of setup, bring it to the

View File

@ -50,7 +50,9 @@ typedef int PRInt32;
#include "resource.h"
#include "zipfile.h"
#define CLASS_NAME_SETUP "Setup"
#define DEFAULT_SETUP_WINDOW_NAME "Setup"
/* Class name for the invisible window to be created */
#define CLASS_NAME_SETUP "MozillaSetup"
#define CLASS_NAME_SETUP_DLG "MozillaSetupDlg"
#define FILE_INI_SETUP "setup.ini"
#define FILE_INI_CONFIG "config.ini"
@ -92,6 +94,10 @@ typedef int PRInt32;
#define INCLUDE_INVISIBLE_OBJS TRUE
#define SKIP_INVISIBLE_OBJS FALSE
#define NO_BANNER_IMAGE 0x00000000
#define BANNER_IMAGE_DOWNLOAD 0x00000001
#define BANNER_IMAGE_INSTALLING 0x00000002
#define APPPATH_GRE_PATH_SET 0x00000000
#define APPPATH_GRE_PATH_NOT_SET 0x00000001
#define APPPATH_GRE_PATH_ALREADY_SET 0x00000002
@ -572,6 +578,7 @@ typedef struct dlgInstall
char szProgramFolder_[MAX_BUF];
char szExistingFolder_[MAX_BUF];
char szSetupMessage[MAX_BUF];
char szRestart[MAX_BUF];
char szYesRestart[MAX_BUF];
char szNoRestart[MAX_BUF];
char szAdditionalComponents_[MAX_BUF];
@ -618,6 +625,8 @@ struct sSysInfo
DWORD dwMemoryAvailablePhysical;
DWORD dwScreenX;
DWORD dwScreenY;
DWORD lastWindowPosCenterX;
DWORD lastWindowPosCenterY;
BOOL bScreenReader;
BOOL bRefreshIcons;
};

View File

@ -442,21 +442,6 @@ void cbXPIFinal(const char *URL, PRInt32 finalStatus)
/////////////////////////////////////////////////////////////////////////////
// Progress bar
// Centers the specified window over the desktop. Assumes the window is
// smaller both horizontally and vertically than the desktop
static void
CenterWindow(HWND hWndDlg)
{
RECT rect;
int iLeft, iTop;
GetWindowRect(hWndDlg, &rect);
iLeft = (GetSystemMetrics(SM_CXSCREEN) - (rect.right - rect.left)) / 2;
iTop = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
SetWindowPos(hWndDlg, NULL, iLeft, iTop, -1, -1, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
}
// Window proc for dialog
LRESULT CALLBACK
ProgressDlgProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@ -465,7 +450,7 @@ ProgressDlgProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
case WM_INITDIALOG:
DisableSystemMenuItems(hWndDlg, TRUE);
CenterWindow(hWndDlg);
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);
@ -839,6 +824,7 @@ void DeInitProgressDlg()
{
if(sgProduct.mode != SILENT)
{
SaveWindowPosition(dlgInfo.hWndDlg);
DestroyWindow(dlgInfo.hWndDlg);
UnregisterClass("GaugeFile", hInst);
UnregisterClass("GaugeArchive", hInst);

View File

@ -1229,23 +1229,6 @@ int ProgressCB(int aBytesSoFar, int aTotalFinalSize)
return(iRv);
}
/////////////////////////////////////////////////////////////////////////////
// Progress bar
// Centers the specified window over the desktop. Assumes the window is
// smaller both horizontally and vertically than the desktop
static void
CenterWindow(HWND hWndDlg)
{
RECT rect;
int iLeft, iTop;
GetWindowRect(hWndDlg, &rect);
iLeft = (GetSystemMetrics(SM_CXSCREEN) - (rect.right - rect.left)) / 2;
iTop = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
SetWindowPos(hWndDlg, NULL, iLeft, iTop, -1, -1, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
}
// Window proc for dialog
LRESULT CALLBACK
DownloadDlgProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@ -1260,7 +1243,7 @@ DownloadDlgProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
sizeof(gszFileInfo),
szFileIniConfig);
DisableSystemMenuItems(hWndDlg, FALSE);
CenterWindow(hWndDlg);
RepositionWindow(hWndDlg, BANNER_IMAGE_DOWNLOAD);
if(gbShowDownloadRetryMsg)
SetDlgItemText(hWndDlg, IDC_MESSAGE0, diDownload.szMessageRetry0);
else
@ -1285,7 +1268,6 @@ 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);
return FALSE;
case WM_SIZE:
@ -1534,6 +1516,7 @@ void DeInitDownloadDlg()
{
if(sgProduct.mode != SILENT)
{
SaveWindowPosition(dlgInfo.hWndDlg);
DestroyWindow(dlgInfo.hWndDlg);
UnregisterClass("GaugeFile", hInst);
}

View File

@ -16,7 +16,7 @@
#define IDI_SETUP 105
#define IDB_BITMAP_WELCOME 108
#define DLG_MESSAGE 110
#define IDB_BITMAP_DOWNLOAD_LOGO 114
#define IDB_BITMAP_BANNER 114
#define IDB_QUICK_LAUNCH 115
#define DLG_BROWSE_DIR 503
#define IDC_STATUS 1001
@ -141,7 +141,7 @@
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 116
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1078
#define _APS_NEXT_CONTROL_VALUE 1079
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@ -63,7 +63,7 @@ BEGIN
LTEXT "",IDC_STATIC0,101,11,202,37,NOT WS_GROUP
LTEXT "",IDC_STATIC1,102,53,201,37,NOT WS_GROUP
LTEXT "",IDC_STATIC2,102,96,201,37,NOT WS_GROUP
CONTROL
CONTROL
#ifndef __MINGW32__
108,
#endif
@ -100,7 +100,7 @@ BEGIN
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
PUSHBUTTON "",IDCANCEL,252,186,53,14
LTEXT "",IDC_STATIC_MSG0,101,11,204,17,NOT WS_GROUP
CONTROL
CONTROL
#ifndef __MINGW32__
108,
#endif
@ -129,7 +129,7 @@ BEGIN
GROUPBOX "",IDC_STATIC,101,140,204,33
LTEXT "",IDC_DOWNLOAD_SIZE,105,160,92,8,NOT WS_GROUP
LTEXT "",IDC_SPACE_AVAILABLE,206,160,94,8,NOT WS_GROUP
CONTROL
CONTROL
#ifndef __MINGW32__
108,
#endif
@ -161,7 +161,7 @@ BEGIN
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
PUSHBUTTON "",IDCANCEL,252,186,53,14
LTEXT "",IDC_MESSAGE0,101,11,204,17,NOT WS_GROUP
CONTROL
CONTROL
#ifndef __MINGW32__
108,
#endif
@ -186,7 +186,7 @@ BEGIN
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
PUSHBUTTON "",IDCANCEL,252,186,53,14
LTEXT "",IDC_MESSAGE0,101,11,204,33,NOT WS_GROUP
CONTROL
CONTROL
#ifndef __MINGW32__
108,
#endif
@ -227,7 +227,7 @@ BEGIN
LTEXT "",IDC_MESSAGE0,101,14,204,18,NOT WS_GROUP
LTEXT "",IDC_MESSAGE1,101,50,204,20,NOT WS_GROUP
LTEXT "",IDC_MESSAGE2,101,127,204,18,NOT WS_GROUP
CONTROL
CONTROL
#ifndef __MINGW32__
108,
#endif
@ -235,7 +235,7 @@ BEGIN
WS_EX_CLIENTEDGE
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE
CONTROL
CONTROL
#ifndef __MINGW32__
115,
#endif
@ -294,11 +294,11 @@ BEGIN
CONTROL "",IDC_STATUS3,"Static",SS_LEFTNOWORDWRAP | SS_NOPREFIX |
WS_GROUP,12,98,286,8
CONTROL "",IDC_GAUGE_FILE,"GaugeFile",0x0,12,110,286,11
CONTROL
CONTROL
#ifndef __MINGW32__
114,
#endif
IDC_STATIC,"Static",SS_BITMAP,0,0,312,34
IDB_BITMAP_BANNER,"Static",SS_BITMAP,0,0,312,34
END
DLG_ADVANCED_SETTINGS DIALOG DISCARDABLE 51, 56, 315, 205
@ -318,7 +318,7 @@ BEGIN
9
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
PUSHBUTTON "",IDCANCEL,252,186,53,14
CONTROL
CONTROL
#ifndef __MINGW32__
108,
#endif
@ -353,7 +353,7 @@ BEGIN
GROUPBOX "",IDC_STATIC,101,140,204,33
LTEXT "",IDC_DOWNLOAD_SIZE,105,160,92,8,NOT WS_GROUP
LTEXT "",IDC_SPACE_AVAILABLE,206,160,94,8,NOT WS_GROUP
CONTROL
CONTROL
#ifndef __MINGW32__
108,
#endif
@ -370,13 +370,13 @@ DLG_UPGRADE DIALOG DISCARDABLE 51, 56, 310, 166
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "",IDWIZBACK,162,139,53,14
PUSHBUTTON "",ID_DELETE,95,139,53,14
LTEXT "",IDC_MESSAGE0,17,13,276,31,NOT WS_GROUP
LTEXT "",IDC_MESSAGE1,17,48,276,21,NOT WS_GROUP
LTEXT "",IDC_MESSAGE2,17,73,276,21,NOT WS_GROUP
GROUPBOX "",IDC_STATIC,16,102,276,25
LTEXT "",IDC_DELETE_PATH,22,111,264,13,SS_CENTERIMAGE
PUSHBUTTON "",ID_DELETE,95,139,53,14
DEFPUSHBUTTON "",IDWIZBACK,162,139,53,14
END
DLG_ADDITIONAL_OPTIONS DIALOG DISCARDABLE 51, 56, 315, 205
@ -385,25 +385,25 @@ STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
CLASS "MozillaSetupDlg"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "",IDC_CHECK_RECAPTURE_HOMEPAGE,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,100,56,202,8
LTEXT "",IDC_MESSAGE1,100,76,204,33,NOT WS_GROUP
CONTROL "",IDC_CHECK_SAVE_INSTALLER_FILES,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,100,112,204,9
EDITTEXT IDC_EDIT_LOCAL_INSTALLER_PATH,100,124,204,12,
ES_AUTOHSCROLL | ES_READONLY
LTEXT "",IDC_MESSAGE0,100,20,204,33,NOT WS_GROUP
PUSHBUTTON "",IDC_BUTTON_PROXY_SETTINGS,221,159,84,14
PUSHBUTTON "",IDWIZBACK,134,186,53,14
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
PUSHBUTTON "",IDCANCEL,252,186,53,14
LTEXT "",IDC_MESSAGE1,100,76,204,33,NOT WS_GROUP
CONTROL
LTEXT "",IDC_MESSAGE0,100,20,204,33,NOT WS_GROUP
CONTROL
#ifndef __MINGW32__
108,
#endif
-1,"Static",SS_BITMAP,11,11,83,162,WS_EX_CLIENTEDGE
CONTROL "",-1,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE
CONTROL "",IDC_CHECK_RECAPTURE_HOMEPAGE,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,100,56,202,8
END
DLG_DOWNLOADING DIALOG DISCARDABLE 0, 0, 312, 154
@ -427,11 +427,11 @@ BEGIN
SS_NOPREFIX | WS_GROUP,49,72,253,8
CONTROL "",IDC_GAUGE_FILE,"GaugeFile",0x0,9,114,271,11
LTEXT "",IDC_PERCENTAGE,283,115,20,8,SS_NOPREFIX
CONTROL
CONTROL
#ifndef __MINGW32__
114,
#endif
IDC_STATIC,"Static",SS_BITMAP,0,0,312,34
IDB_BITMAP_BANNER,"Static",SS_BITMAP,0,0,312,34
LTEXT "",IDC_STATIC4,9,91,37,8,SS_NOPREFIX
CONTROL "",IDC_STATUS_TO,"Static",SS_LEFTNOWORDWRAP |
SS_NOPREFIX | WS_GROUP,49,91,253,8
@ -443,13 +443,13 @@ STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
CLASS "MozillaSetupDlg"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
PUSHBUTTON "",IDWIZBACK,134,186,53,14
PUSHBUTTON "",IDCANCEL,252,186,53,14
EDITTEXT IDC_CURRENT_SETTINGS,101,67,204,102,ES_MULTILINE |
ES_OEMCONVERT | ES_READONLY | WS_VSCROLL | WS_HSCROLL
PUSHBUTTON "",IDWIZBACK,134,186,53,14
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
PUSHBUTTON "",IDCANCEL,252,186,53,14
LTEXT "",IDC_MESSAGE0,101,11,204,52,NOT WS_GROUP
CONTROL
CONTROL
#ifndef __MINGW32__
108,
#endif
@ -478,7 +478,7 @@ IDB_BOX_UNCHECKED BITMAP FIXED IMPURE "box_unch.bmp"
IDB_BOX_CHECKED BITMAP FIXED IMPURE "box_chec.bmp"
IDB_BITMAP_WELCOME BITMAP DISCARDABLE "bitmap1.bmp"
IDB_BOX_CHECKED_DISABLED BITMAP FIXED IMPURE "box_ch_d.bmp"
IDB_BITMAP_DOWNLOAD_LOGO BITMAP DISCARDABLE "downloadLogo.bmp"
IDB_BITMAP_BANNER BITMAP DISCARDABLE "downloadLogo.bmp"
IDB_QUICK_LAUNCH BITMAP DISCARDABLE "turbo-systray.bmp"
/////////////////////////////////////////////////////////////////////////////