зеркало из https://github.com/mozilla/pjs.git
Bucket O'Updates
The installer now actually installs! Provided it doesn't have to download anything. And it just stops at the end. Oh well. In time...
This commit is contained in:
Родитель
845de44749
Коммит
35daf65061
|
@ -810,6 +810,10 @@ SOURCE=..\..\..\..\..\browser\installer\windows\xpcom.jst
|
|||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\setuprsc\bitmap1.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\setuprsc\Header.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -33,7 +33,6 @@ LRESULT CALLBACK DlgProcSelectComponents(HWND hDlg, UINT msg, WPARAM wParam, LO
|
|||
LRESULT CALLBACK DlgProcSelectInstallPath(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcSelectAdditionalComponents(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcWindowsIntegration(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcProgramFolder(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcAdditionalOptions(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcAdvancedSettings(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcQuickLaunch(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
|
@ -46,12 +45,17 @@ LRESULT CALLBACK DlgProcMessage(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam
|
|||
LRESULT CALLBACK NewListBoxWndProc( HWND, UINT, WPARAM, LPARAM);
|
||||
LRESULT CALLBACK DlgProcUpgrade(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
|
||||
BOOL IsSelectableComponent(siC* aComponent);
|
||||
HFONT MakeFont(TCHAR* aFaceName, int aFontSize, LONG aWeight);
|
||||
void SaveUserChanges();
|
||||
BOOL IsDownloadRequired();
|
||||
BOOL InstallFiles(HWND hDlg);
|
||||
|
||||
void ToggleCheck(HWND hwndListBox, DWORD dwIndex, DWORD dwACFlag);
|
||||
BOOL AskCancelDlg(HWND hDlg);
|
||||
void lbAddItem(HWND hList, siC *siCComponent);
|
||||
HWND InstantiateDialog(HWND hParent, DWORD dwDlgID, LPSTR szTitle, WNDPROC wpDlgProc);
|
||||
void InitSequence(HINSTANCE hInstance);
|
||||
void DlgSequence(int iDirection);
|
||||
void PaintGradientShade(HWND hWnd, HDC hdc);
|
||||
void BrowseForDirectory(HWND hDlg);
|
||||
LRESULT CALLBACK BrowseHookProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
|
|
@ -452,7 +452,7 @@ char *GetSetupCurrentDownloadFile(char *szCurrentDownloadFile,
|
|||
return(szCurrentDownloadFile);
|
||||
}
|
||||
|
||||
void UpdateGREAppInstallerProgress(int percent)
|
||||
void UpdateGREInstallProgress(int percent)
|
||||
{
|
||||
if (lpfnProgressUpd)
|
||||
lpfnProgressUpd(GRE_INSTALLER_ID, percent);
|
||||
|
@ -5351,6 +5351,8 @@ HRESULT ParseComponentAttributes(char *szAttribute, DWORD dwAttributes, BOOL bOv
|
|||
dwAttributes |= SIC_IGNORE_XPINSTALL_ERROR;
|
||||
if(strstr(szBuf, "UNCOMPRESS"))
|
||||
dwAttributes |= SIC_UNCOMPRESS;
|
||||
if(strstr(szBuf, "MAIN_COMPONENT"))
|
||||
dwAttributes |= SIC_MAIN_COMPONENT;
|
||||
}
|
||||
|
||||
if(strstr(szBuf, "UNSELECTED"))
|
||||
|
@ -7756,7 +7758,11 @@ HRESULT ParseInstallIni()
|
|||
GetPrivateProfileString("General", "BROWSE_", "", sgInstallGui.szBrowse_, sizeof(sgInstallGui.szBrowse_), szFileIniInstall);
|
||||
GetPrivateProfileString("General", "DOWNLOADSIZE", "", sgInstallGui.szDownloadSize, sizeof(sgInstallGui.szDownloadSize), szFileIniInstall);
|
||||
GetPrivateProfileString("General", "CURRENTSETTINGS", "", sgInstallGui.szCurrentSettings, sizeof(sgInstallGui.szCurrentSettings), szFileIniInstall);
|
||||
GetPrivateProfileString("General", "INSTALL_", "", sgInstallGui.szInstall_, sizeof(sgInstallGui.szInstall_), szFileIniInstall);
|
||||
GetPrivateProfileString("General", "INSTALLFOLDER", "", sgInstallGui.szInstallFolder, sizeof(sgInstallGui.szInstallFolder), szFileIniInstall);
|
||||
GetPrivateProfileString("General", "ADDTLCOMPWRAPPER", "", sgInstallGui.szAddtlCompWrapper, sizeof(sgInstallGui.szAddtlCompWrapper), szFileIniInstall);
|
||||
GetPrivateProfileString("General", "PRIMCOMPNOOTHERS", "", sgInstallGui.szPrimCompNoOthers, sizeof(sgInstallGui.szPrimCompNoOthers), szFileIniInstall);
|
||||
GetPrivateProfileString("General", "PRIMCOMPOTHERS", "", sgInstallGui.szPrimCompOthers, sizeof(sgInstallGui.szPrimCompOthers), szFileIniInstall);
|
||||
GetPrivateProfileString("General", "INSTALL_", "", sgInstallGui.szInstall_, sizeof(sgInstallGui.szInstall_), szFileIniInstall);
|
||||
GetPrivateProfileString("General", "DELETE_", "", sgInstallGui.szDelete_, sizeof(sgInstallGui.szDelete_), szFileIniInstall);
|
||||
GetPrivateProfileString("General", "CONTINUE_", "", sgInstallGui.szContinue_, sizeof(sgInstallGui.szContinue_), szFileIniInstall);
|
||||
GetPrivateProfileString("General", "SKIP_", "", sgInstallGui.szSkip_, sizeof(sgInstallGui.szSkip_), szFileIniInstall);
|
||||
|
|
|
@ -232,7 +232,7 @@ HRESULT ProcessXpinstallEngine(void);
|
|||
void GetXpinstallPath(char *aPath, int aPathBufSize);
|
||||
BOOL GreInstallerNeedsReboot(void);
|
||||
void ReplacePrivateProfileStrCR(LPSTR aInputOutputStr);
|
||||
void UpdateGREAppInstallerProgress(int percent);
|
||||
void UpdateGREInstallProgress(int percent);
|
||||
BOOL IsPathWithinWindir();
|
||||
void CleanupOnUpgrade();
|
||||
BOOL IsInstallerProductGRE(void);
|
||||
|
|
|
@ -269,6 +269,7 @@ typedef int PRInt32;
|
|||
#define SIC_IGNORE_XPINSTALL_ERROR 0x00000200
|
||||
#define SIC_UNCOMPRESS 0x00000400
|
||||
#define SIC_SUPERSEDE 0x00000800
|
||||
#define SIC_MAIN_COMPONENT 0x00001000
|
||||
|
||||
/* AC: Additional Components */
|
||||
#define AC_NONE 0
|
||||
|
@ -634,6 +635,10 @@ typedef struct dlgInstall
|
|||
char szBrowse_[MAX_BUF];
|
||||
char szDownloadSize[MAX_BUF];
|
||||
char szCurrentSettings[MAX_BUF];
|
||||
char szInstallFolder[MAX_BUF];
|
||||
char szPrimCompNoOthers[MAX_BUF];
|
||||
char szPrimCompOthers[MAX_BUF];
|
||||
char szAddtlCompWrapper[MAX_BUF];
|
||||
char szInstall_[MAX_BUF];
|
||||
char szDelete_[MAX_BUF];
|
||||
char szContinue_[MAX_BUF];
|
||||
|
|
|
@ -56,8 +56,7 @@ char szStrInstalling[MAX_BUF];
|
|||
static char gSavedCwd[MAX_BUF];
|
||||
|
||||
static void UpdateGaugeFileProgressBar(unsigned value);
|
||||
static void UpdateGaugeArchiveProgressBar(unsigned value);
|
||||
static void UpdateGaugeFileBarber(void);
|
||||
static void UpdateArchiveInstallProgress(int aValue);
|
||||
|
||||
struct ExtractFilesDlgInfo
|
||||
{
|
||||
|
@ -193,25 +192,7 @@ char *GetErrorString(DWORD dwError, char *szErrorString, DWORD dwErrorStringSize
|
|||
return(szErrorString);
|
||||
}
|
||||
|
||||
/* function that clears the file progress bar of the xpinstall progress
|
||||
* dialog.
|
||||
*/
|
||||
void InvalidateBarberBarArea()
|
||||
{
|
||||
HWND hWndGauge;
|
||||
RECT rect;
|
||||
|
||||
/* get the file progress bar gauge */
|
||||
hWndGauge = GetDlgItem(dlgInfo.hWndDlg, IDC_GAUGE_FILE);
|
||||
/* get the dimensions of the gauge */
|
||||
GetClientRect(hWndGauge, &rect);
|
||||
/* invalidate the rect area of the gauge */
|
||||
InvalidateRect(hWndGauge, &rect, FALSE);
|
||||
/* update the dialog */
|
||||
UpdateWindow(dlgInfo.hWndDlg);
|
||||
}
|
||||
|
||||
HRESULT SmartUpdateJars()
|
||||
HRESULT SmartUpdateJars(HWND aWizardPanel)
|
||||
{
|
||||
DWORD dwIndex0;
|
||||
siC *siCObject = NULL;
|
||||
|
@ -224,18 +205,39 @@ HRESULT SmartUpdateJars()
|
|||
char xpinstallPath[MAX_BUF];
|
||||
char xpiArgs[MAX_BUF];
|
||||
|
||||
if(!GetPrivateProfileString("Messages", "MSG_SMARTUPDATE_START", "", szMsgSmartUpdateStart, sizeof(szMsgSmartUpdateStart), szFileIniInstall))
|
||||
return(1);
|
||||
if(!GetPrivateProfileString("Messages", "DLG_EXTRACTING_TITLE", "", szDlgExtractingTitle, sizeof(szDlgExtractingTitle), szFileIniInstall))
|
||||
return(1);
|
||||
if(!GetPrivateProfileString("Messages", "STR_PROCESSINGFILE", "", szStrProcessingFile, sizeof(szStrProcessingFile), szFileIniInstall))
|
||||
exit(1);
|
||||
if(!GetPrivateProfileString("Messages", "STR_INSTALLING", "", szStrInstalling, sizeof(szStrInstalling), szFileIniInstall))
|
||||
exit(1);
|
||||
if(!GetPrivateProfileString("Messages", "STR_COPYINGFILE", "", szStrCopyingFile, sizeof(szStrCopyingFile), szFileIniInstall))
|
||||
// Save the handle to the dialog window so the installer procedures
|
||||
// can send messages to it.
|
||||
dlgInfo.hWndDlg = aWizardPanel;
|
||||
|
||||
if (!GetPrivateProfileString("Messages", "MSG_SMARTUPDATE_START",
|
||||
"", szMsgSmartUpdateStart,
|
||||
sizeof(szMsgSmartUpdateStart),
|
||||
szFileIniInstall) ||
|
||||
!GetPrivateProfileString("Messages", "DLG_EXTRACTING_TITLE",
|
||||
"", szDlgExtractingTitle,
|
||||
sizeof(szDlgExtractingTitle),
|
||||
szFileIniInstall))
|
||||
return 1;
|
||||
|
||||
if (!GetPrivateProfileString("Messages", "STR_PROCESSINGFILE",
|
||||
"", szStrProcessingFile,
|
||||
sizeof(szStrProcessingFile),
|
||||
szFileIniInstall) ||
|
||||
!GetPrivateProfileString("Messages", "STR_INSTALLING",
|
||||
"", szStrInstalling,
|
||||
sizeof(szStrInstalling),
|
||||
szFileIniInstall) ||
|
||||
!GetPrivateProfileString("Messages", "STR_COPYINGFILE",
|
||||
"", szStrCopyingFile,
|
||||
sizeof(szStrCopyingFile),
|
||||
szFileIniInstall))
|
||||
exit(1);
|
||||
|
||||
#if 0
|
||||
// XXXben fix me
|
||||
ShowMessage(szMsgSmartUpdateStart, TRUE);
|
||||
#endif
|
||||
|
||||
GetXpinstallPath(xpinstallPath, sizeof(xpinstallPath));
|
||||
if(InitializeXPIStub(xpinstallPath) == WIZ_OK)
|
||||
{
|
||||
|
@ -248,10 +250,12 @@ HRESULT SmartUpdateJars()
|
|||
}
|
||||
hrResult = pfnXpiInit(szBuf, FILE_INSTALL_LOG, cbXPIProgress);
|
||||
|
||||
#if 0
|
||||
// XXXben fix me
|
||||
ShowMessage(szMsgSmartUpdateStart, FALSE);
|
||||
InitProgressDlg();
|
||||
#endif
|
||||
|
||||
GetTotalArchivesToInstall();
|
||||
SetWindowText(dlgInfo.hWndDlg, szDlgExtractingTitle);
|
||||
|
||||
dwIndex0 = 0;
|
||||
dwCurrentArchive = 0;
|
||||
|
@ -273,6 +277,9 @@ HRESULT SmartUpdateJars()
|
|||
lBarberCounter = 0;
|
||||
dwBarberDirection = BDIR_RIGHT;
|
||||
dlgInfo.nFileBars = 0;
|
||||
|
||||
SendMessage(aWizardPanel, WM_PAINT, 0, 0);
|
||||
|
||||
UpdateGaugeFileProgressBar(0);
|
||||
|
||||
lstrcpy(szArchive, sgProduct.szAlternateArchiveSearchPath);
|
||||
|
@ -305,8 +312,9 @@ HRESULT SmartUpdateJars()
|
|||
if(dwCurrentArchive == 0)
|
||||
{
|
||||
++dwCurrentArchive;
|
||||
UpdateGaugeArchiveProgressBar((unsigned)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
|
||||
UpdateGREAppInstallerProgress((unsigned)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
|
||||
|
||||
UpdateArchiveInstallProgress((int)(((double)dwCurrentArchive/(double)dwTotalArchives)*(double)100));
|
||||
UpdateGREInstallProgress((int)(((double)dwCurrentArchive/(double)dwTotalArchives)*(double)100));
|
||||
}
|
||||
|
||||
wsprintf(szBuf, szStrInstalling, siCObject->szDescriptionShort);
|
||||
|
@ -350,8 +358,8 @@ HRESULT SmartUpdateJars()
|
|||
}
|
||||
|
||||
++dwCurrentArchive;
|
||||
UpdateGaugeArchiveProgressBar((unsigned)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
|
||||
UpdateGREAppInstallerProgress((unsigned)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
|
||||
UpdateArchiveInstallProgress((int)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
|
||||
UpdateGREInstallProgress((int)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
|
||||
|
||||
ProcessWindowsMessages();
|
||||
LogISXPInstallComponentResult(hrResult);
|
||||
|
@ -374,10 +382,9 @@ HRESULT SmartUpdateJars()
|
|||
} /* while(siCObject) */
|
||||
|
||||
//report 100% progress status for successful installs
|
||||
UpdateGREAppInstallerProgress(100);
|
||||
UpdateGREInstallProgress(100);
|
||||
LogMSXPInstallStatus(NULL, hrResult);
|
||||
pfnXpiExit();
|
||||
DeInitProgressDlg();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -409,7 +416,8 @@ void cbXPIProgress(const char* msg, PRInt32 val, PRInt32 max)
|
|||
wsprintf(szStrProcessingFileBuf, szStrProcessingFile, szFilename);
|
||||
SetDlgItemText(dlgInfo.hWndDlg, IDC_STATUS3, szStrProcessingFileBuf);
|
||||
bBarberBar = TRUE;
|
||||
UpdateGaugeFileBarber();
|
||||
// XXXben
|
||||
// UpdateGaugeFileBarber();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -417,10 +425,11 @@ void cbXPIProgress(const char* msg, PRInt32 val, PRInt32 max)
|
|||
{
|
||||
dlgInfo.nFileBars = 0;
|
||||
++dwCurrentArchive;
|
||||
UpdateGaugeArchiveProgressBar((unsigned)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
|
||||
UpdateGREAppInstallerProgress((unsigned)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
|
||||
UpdateArchiveInstallProgress((int)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
|
||||
UpdateGREInstallProgress((int)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
|
||||
|
||||
InvalidateBarberBarArea();
|
||||
// XXXben
|
||||
// InvalidateBarberBarArea();
|
||||
bBarberBar = FALSE;
|
||||
}
|
||||
|
||||
|
@ -439,394 +448,18 @@ void cbXPIFinal(const char *URL, PRInt32 finalStatus)
|
|||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Progress bar
|
||||
|
||||
// Window proc for dialog
|
||||
LRESULT CALLBACK
|
||||
ProgressDlgProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
// Update the Archive Progress Bar to the specified percentage.
|
||||
static void UpdateArchiveInstallProgress(int aValue)
|
||||
{
|
||||
switch (msg)
|
||||
{
|
||||
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);
|
||||
return FALSE;
|
||||
HWND progressBar;
|
||||
|
||||
case WM_COMMAND:
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE; // didn't handle the message
|
||||
}
|
||||
|
||||
// This routine will update the File Gauge progress bar to the specified percentage
|
||||
// (value between 0 and 100)
|
||||
static void
|
||||
UpdateGaugeFileBarber()
|
||||
{
|
||||
int nBars;
|
||||
HWND hWndGauge;
|
||||
RECT rect;
|
||||
|
||||
if(sgProduct.mode != SILENT)
|
||||
{
|
||||
hWndGauge = GetDlgItem(dlgInfo.hWndDlg, IDC_GAUGE_FILE);
|
||||
if(dwBarberDirection == BDIR_RIGHT)
|
||||
{
|
||||
// 121 is the (number of bars) + (number bars in barber bar).
|
||||
// this number determines how far to the right to draw the barber bat
|
||||
// so as to make it look like it disappears off the progress meter area.
|
||||
if(lBarberCounter < 121)
|
||||
++lBarberCounter;
|
||||
else
|
||||
dwBarberDirection = BDIR_LEFT;
|
||||
}
|
||||
else if(dwBarberDirection == BDIR_LEFT)
|
||||
{
|
||||
if(lBarberCounter > 0)
|
||||
--lBarberCounter;
|
||||
else
|
||||
dwBarberDirection = BDIR_RIGHT;
|
||||
}
|
||||
|
||||
// Figure out how many bars should be displayed
|
||||
nBars = (dlgInfo.nMaxFileBars * lBarberCounter / 100);
|
||||
|
||||
// Update the gauge state before painting
|
||||
dlgInfo.nFileBars = nBars;
|
||||
|
||||
// Only invalidate the part that needs updating
|
||||
GetClientRect(hWndGauge, &rect);
|
||||
InvalidateRect(hWndGauge, &rect, FALSE);
|
||||
|
||||
// Update the whole extracting dialog. We do this because we don't
|
||||
// have a message loop to process WM_PAINT messages in case the
|
||||
// extracting dialog was exposed
|
||||
UpdateWindow(dlgInfo.hWndDlg);
|
||||
if (sgProduct.mode != SILENT) {
|
||||
progressBar = GetDlgItem(dlgInfo.hWndDlg, IDC_PROGRESS_ARCHIVE);
|
||||
SendMessage(progressBar, PBM_SETPOS, aValue, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// This routine will update the File Gauge progress bar to the specified percentage
|
||||
// (value between 0 and 100)
|
||||
static void
|
||||
UpdateGaugeFileProgressBar(unsigned value)
|
||||
static void UpdateGaugeFileProgressBar(unsigned value)
|
||||
{
|
||||
int nBars;
|
||||
|
||||
if(sgProduct.mode != SILENT)
|
||||
{
|
||||
// Figure out how many bars should be displayed
|
||||
nBars = dlgInfo.nMaxFileBars * value / 100;
|
||||
|
||||
// Only paint if we need to display more bars
|
||||
if((nBars > dlgInfo.nFileBars) || (dlgInfo.nFileBars == 0))
|
||||
{
|
||||
HWND hWndGauge = GetDlgItem(dlgInfo.hWndDlg, IDC_GAUGE_FILE);
|
||||
RECT rect;
|
||||
|
||||
// Update the gauge state before painting
|
||||
dlgInfo.nFileBars = nBars;
|
||||
|
||||
// Only invalidate the part that needs updating
|
||||
GetClientRect(hWndGauge, &rect);
|
||||
InvalidateRect(hWndGauge, &rect, FALSE);
|
||||
|
||||
// Update the whole extracting dialog. We do this because we don't
|
||||
// have a message loop to process WM_PAINT messages in case the
|
||||
// extracting dialog was exposed
|
||||
UpdateWindow(dlgInfo.hWndDlg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This routine will update the Archive Gauge progress bar to the specified percentage
|
||||
// (value between 0 and 100)
|
||||
static void
|
||||
UpdateGaugeArchiveProgressBar(unsigned value)
|
||||
{
|
||||
int nBars;
|
||||
|
||||
if(sgProduct.mode != SILENT)
|
||||
{
|
||||
// Figure out how many bars should be displayed
|
||||
nBars = dlgInfo.nMaxArchiveBars * value / 100;
|
||||
|
||||
// Only paint if we need to display more bars
|
||||
if (nBars > dlgInfo.nArchiveBars)
|
||||
{
|
||||
HWND hWndGauge = GetDlgItem(dlgInfo.hWndDlg, IDC_GAUGE_ARCHIVE);
|
||||
RECT rect;
|
||||
|
||||
// Update the gauge state before painting
|
||||
dlgInfo.nArchiveBars = nBars;
|
||||
|
||||
// Only invalidate the part that needs updating
|
||||
GetClientRect(hWndGauge, &rect);
|
||||
InvalidateRect(hWndGauge, &rect, FALSE);
|
||||
|
||||
// Update the whole extracting dialog. We do this because we don't
|
||||
// have a message loop to process WM_PAINT messages in case the
|
||||
// extracting dialog was exposed
|
||||
UpdateWindow(dlgInfo.hWndDlg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Draws a recessed border around the gauge
|
||||
static void
|
||||
DrawGaugeBorder(HWND hWnd)
|
||||
{
|
||||
HDC hDC = GetWindowDC(hWnd);
|
||||
RECT rect;
|
||||
int cx, cy;
|
||||
HPEN hShadowPen = CreatePen(PS_SOLID, 1, GetSysColor(COLOR_BTNSHADOW));
|
||||
HGDIOBJ hOldPen;
|
||||
|
||||
GetWindowRect(hWnd, &rect);
|
||||
cx = rect.right - rect.left;
|
||||
cy = rect.bottom - rect.top;
|
||||
|
||||
// Draw a dark gray line segment
|
||||
hOldPen = SelectObject(hDC, (HGDIOBJ)hShadowPen);
|
||||
MoveToEx(hDC, 0, cy - 1, NULL);
|
||||
LineTo(hDC, 0, 0);
|
||||
LineTo(hDC, cx - 1, 0);
|
||||
|
||||
// Draw a white line segment
|
||||
SelectObject(hDC, GetStockObject(WHITE_PEN));
|
||||
MoveToEx(hDC, 0, cy - 1, NULL);
|
||||
LineTo(hDC, cx - 1, cy - 1);
|
||||
LineTo(hDC, cx - 1, 0);
|
||||
|
||||
SelectObject(hDC, hOldPen);
|
||||
DeleteObject(hShadowPen);
|
||||
ReleaseDC(hWnd, hDC);
|
||||
}
|
||||
|
||||
// Draws the blue progress bar
|
||||
static void
|
||||
DrawProgressBar(HWND hWnd, int nBars)
|
||||
{
|
||||
int i;
|
||||
PAINTSTRUCT ps;
|
||||
HDC hDC;
|
||||
RECT rect;
|
||||
HBRUSH hBrush;
|
||||
|
||||
hDC = BeginPaint(hWnd, &ps);
|
||||
GetClientRect(hWnd, &rect);
|
||||
if(nBars <= 0)
|
||||
{
|
||||
/* clear the bars */
|
||||
hBrush = CreateSolidBrush(GetSysColor(COLOR_MENU));
|
||||
FillRect(hDC, &rect, hBrush);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Draw the bars
|
||||
hBrush = CreateSolidBrush(RGB(0, 0, 128));
|
||||
rect.left = rect.top = BAR_MARGIN;
|
||||
rect.bottom -= BAR_MARGIN;
|
||||
rect.right = rect.left + BAR_WIDTH;
|
||||
|
||||
for(i = 0; i < nBars; i++)
|
||||
{
|
||||
RECT dest;
|
||||
|
||||
if(IntersectRect(&dest, &ps.rcPaint, &rect))
|
||||
FillRect(hDC, &rect, hBrush);
|
||||
|
||||
OffsetRect(&rect, BAR_WIDTH + BAR_SPACING, 0);
|
||||
}
|
||||
}
|
||||
|
||||
DeleteObject(hBrush);
|
||||
EndPaint(hWnd, &ps);
|
||||
}
|
||||
|
||||
// Draws the blue progress bar
|
||||
static void
|
||||
DrawBarberBar(HWND hWnd, int nBars)
|
||||
{
|
||||
int i;
|
||||
PAINTSTRUCT ps;
|
||||
HDC hDC;
|
||||
RECT rect;
|
||||
HBRUSH hBrush = NULL;
|
||||
HBRUSH hBrushClear = NULL;
|
||||
|
||||
hDC = BeginPaint(hWnd, &ps);
|
||||
GetClientRect(hWnd, &rect);
|
||||
if(nBars <= 0)
|
||||
{
|
||||
/* clear the bars */
|
||||
hBrushClear = CreateSolidBrush(GetSysColor(COLOR_MENU));
|
||||
FillRect(hDC, &rect, hBrushClear);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Draw the bars
|
||||
hBrushClear = CreateSolidBrush(GetSysColor(COLOR_MENU));
|
||||
hBrush = CreateSolidBrush(RGB(0, 0, 128));
|
||||
rect.left = rect.top = BAR_MARGIN;
|
||||
rect.bottom -= BAR_MARGIN;
|
||||
rect.right = rect.left + BAR_WIDTH;
|
||||
|
||||
for(i = 0; i < (nBars + 1); i++)
|
||||
{
|
||||
RECT dest;
|
||||
|
||||
if(IntersectRect(&dest, &ps.rcPaint, &rect))
|
||||
{
|
||||
if((i >= (nBars - 15)) && (i < nBars))
|
||||
FillRect(hDC, &rect, hBrush);
|
||||
else
|
||||
FillRect(hDC, &rect, hBrushClear);
|
||||
}
|
||||
|
||||
OffsetRect(&rect, BAR_WIDTH + BAR_SPACING, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if(hBrushClear)
|
||||
DeleteObject(hBrushClear);
|
||||
|
||||
if(hBrush)
|
||||
DeleteObject(hBrush);
|
||||
|
||||
EndPaint(hWnd, &ps);
|
||||
}
|
||||
|
||||
// Adjusts the width of the gauge based on the maximum number of bars
|
||||
static void
|
||||
SizeToFitGauge(HWND hWnd, int nMaxBars)
|
||||
{
|
||||
RECT rect;
|
||||
int cx;
|
||||
|
||||
// Get the window size in pixels
|
||||
GetWindowRect(hWnd, &rect);
|
||||
|
||||
// Size the width to fit
|
||||
cx = 2 * GetSystemMetrics(SM_CXBORDER) + 2 * BAR_MARGIN +
|
||||
nMaxBars * BAR_WIDTH + (nMaxBars - 1) * BAR_SPACING;
|
||||
|
||||
SetWindowPos(hWnd, NULL, -1, -1, cx, rect.bottom - rect.top,
|
||||
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
}
|
||||
|
||||
// Window proc for file gauge
|
||||
LRESULT CALLBACK
|
||||
GaugeFileWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
DWORD dwStyle;
|
||||
RECT rect;
|
||||
|
||||
switch(msg)
|
||||
{
|
||||
case WM_NCCREATE:
|
||||
dwStyle = GetWindowLong(hWnd, GWL_STYLE);
|
||||
SetWindowLong(hWnd, GWL_STYLE, dwStyle | WS_BORDER);
|
||||
return(TRUE);
|
||||
|
||||
case WM_CREATE:
|
||||
// Figure out the maximum number of bars that can be displayed
|
||||
GetClientRect(hWnd, &rect);
|
||||
dlgInfo.nFileBars = 0;
|
||||
dlgInfo.nMaxFileBars = (rect.right - rect.left - 2 * BAR_MARGIN + BAR_SPACING) / (BAR_WIDTH + BAR_SPACING);
|
||||
|
||||
// Size the gauge to exactly fit the maximum number of bars
|
||||
SizeToFitGauge(hWnd, dlgInfo.nMaxFileBars);
|
||||
return(FALSE);
|
||||
|
||||
case WM_NCPAINT:
|
||||
DrawGaugeBorder(hWnd);
|
||||
return(FALSE);
|
||||
|
||||
case WM_PAINT:
|
||||
if(bBarberBar == TRUE)
|
||||
DrawBarberBar(hWnd, dlgInfo.nFileBars);
|
||||
else
|
||||
DrawProgressBar(hWnd, dlgInfo.nFileBars);
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
return(DefWindowProc(hWnd, msg, wParam, lParam));
|
||||
}
|
||||
|
||||
// Window proc for file gauge
|
||||
LRESULT CALLBACK
|
||||
GaugeArchiveWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
DWORD dwStyle;
|
||||
RECT rect;
|
||||
|
||||
switch(msg)
|
||||
{
|
||||
case WM_NCCREATE:
|
||||
dwStyle = GetWindowLong(hWnd, GWL_STYLE);
|
||||
SetWindowLong(hWnd, GWL_STYLE, dwStyle | WS_BORDER);
|
||||
return(TRUE);
|
||||
|
||||
case WM_CREATE:
|
||||
// Figure out the maximum number of bars that can be displayed
|
||||
GetClientRect(hWnd, &rect);
|
||||
dlgInfo.nArchiveBars = 0;
|
||||
dlgInfo.nMaxArchiveBars = (rect.right - rect.left - 2 * BAR_MARGIN + BAR_SPACING) / (BAR_WIDTH + BAR_SPACING);
|
||||
|
||||
// Size the gauge to exactly fit the maximum number of bars
|
||||
SizeToFitGauge(hWnd, dlgInfo.nMaxArchiveBars);
|
||||
return(FALSE);
|
||||
|
||||
case WM_NCPAINT:
|
||||
DrawGaugeBorder(hWnd);
|
||||
return(FALSE);
|
||||
|
||||
case WM_PAINT:
|
||||
DrawProgressBar(hWnd, dlgInfo.nArchiveBars);
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
return(DefWindowProc(hWnd, msg, wParam, lParam));
|
||||
}
|
||||
|
||||
void InitProgressDlg()
|
||||
{
|
||||
WNDCLASS wc;
|
||||
|
||||
if(sgProduct.mode != SILENT)
|
||||
{
|
||||
memset(&wc, 0, sizeof(wc));
|
||||
wc.style = CS_GLOBALCLASS;
|
||||
wc.hInstance = hInst;
|
||||
wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
|
||||
wc.lpfnWndProc = (WNDPROC)GaugeFileWndProc;
|
||||
wc.lpszClassName = "GaugeFile";
|
||||
RegisterClass(&wc);
|
||||
|
||||
wc.lpfnWndProc = (WNDPROC)GaugeArchiveWndProc;
|
||||
wc.lpszClassName = "GaugeArchive";
|
||||
RegisterClass(&wc);
|
||||
|
||||
// Display the dialog box
|
||||
dlgInfo.hWndDlg = CreateDialog(hSetupRscInst, MAKEINTRESOURCE(DLG_EXTRACTING), hWndMain, (WNDPROC)ProgressDlgProc);
|
||||
UpdateWindow(dlgInfo.hWndDlg);
|
||||
}
|
||||
}
|
||||
|
||||
void DeInitProgressDlg()
|
||||
{
|
||||
if(sgProduct.mode != SILENT)
|
||||
{
|
||||
SaveWindowPosition(dlgInfo.hWndDlg);
|
||||
DestroyWindow(dlgInfo.hWndDlg);
|
||||
UnregisterClass("GaugeFile", hInst);
|
||||
UnregisterClass("GaugeArchive", hInst);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
HRESULT InitializeXPIStub(char *xpinstallPath);
|
||||
HRESULT DeInitializeXPIStub(void);
|
||||
HRESULT SmartUpdateJars(void);
|
||||
HRESULT SmartUpdateJars(HWND aWizardPanel);
|
||||
void cbXPIStart(const char *, const char *UIName);
|
||||
void cbXPIProgress(const char* msg, PRInt32 val, PRInt32 max);
|
||||
void cbXPIFinal(const char *, PRInt32 finalStatus);
|
||||
|
|
|
@ -1347,7 +1347,7 @@ UpdateGaugeFileProgressBar(double value)
|
|||
// Only paint if we need to display more bars
|
||||
if((nBars > dlgInfo.nFileBars) || (dlgInfo.nFileBars == 0))
|
||||
{
|
||||
HWND hWndGauge = GetDlgItem(dlgInfo.hWndDlg, IDC_GAUGE_FILE);
|
||||
HWND hWndGauge = GetDlgItem(dlgInfo.hWndDlg, IDC_PROGRESS_FILE);
|
||||
RECT rect;
|
||||
|
||||
// Update the gauge state before painting
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#define IDC_STATUS_URL 1001
|
||||
#define IDCONTINUE 1001
|
||||
#define IDC_GAUGE 1002
|
||||
#define IDC_GAUGE_FILE 1002
|
||||
#define IDC_PROGRESS_FILE 1002
|
||||
#define ID_IGNORE 1002
|
||||
#define IDSKIP 1002
|
||||
#define IDC_STATUS2 1003
|
||||
|
@ -38,7 +38,7 @@
|
|||
#define IDC_STATUS3 1005
|
||||
#define ID_YES_TO_ALL 1005
|
||||
#define IDC_STATUS_URL3 1005
|
||||
#define IDC_GAUGE_ARCHIVE 1006
|
||||
#define IDC_PROGRESS_ARCHIVE 1006
|
||||
#define IDC_EDIT_DESTINATION 1009
|
||||
#define IDC_BUTTON_BROWSE 1010
|
||||
#define IDC_EDIT_COMPONENT1 1013
|
||||
|
|
|
@ -224,10 +224,12 @@ FONT 8, "MS Sans Serif"
|
|||
BEGIN
|
||||
CONTROL "",IDC_STATUS0,"Static",SS_LEFTNOWORDWRAP | SS_NOPREFIX |
|
||||
WS_GROUP,11,64,295,8
|
||||
CONTROL "",IDC_GAUGE_ARCHIVE,"GaugeArchive",0x0,11,77,295,11
|
||||
CONTROL "",IDC_STATUS3,"Static",SS_LEFTNOWORDWRAP | SS_NOPREFIX |
|
||||
WS_GROUP,11,98,295,8
|
||||
CONTROL "",IDC_GAUGE_FILE,"GaugeFile",0x0,11,110,295,11
|
||||
CONTROL "Progress1",IDC_PROGRESS_ARCHIVE,"msctls_progress32",
|
||||
WS_BORDER,11,77,295,11
|
||||
CONTROL "Progress1",IDC_PROGRESS_FILE,"msctls_progress32",
|
||||
WS_BORDER,11,110,295,11
|
||||
END
|
||||
|
||||
DLG_ADVANCED_SETTINGS DIALOG DISCARDABLE 51, 56, 315, 205
|
||||
|
@ -339,7 +341,7 @@ BEGIN
|
|||
CONTROL "",IDC_STATUS_FILE,"Static",SS_LEFTNOWORDWRAP |
|
||||
SS_NOPREFIX | WS_GROUP,51,72,254,8
|
||||
LTEXT "",IDC_PERCENTAGE,283,115,20,8,SS_NOPREFIX
|
||||
CONTROL "",IDC_GAUGE_FILE,"msctls_progress32",WS_BORDER,11,85,
|
||||
CONTROL "",IDC_PROGRESS_FILE,"msctls_progress32",WS_BORDER,11,85,
|
||||
295,11
|
||||
END
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче