fixing bug http://bugscape/show_bug.cgi?id=2044 - need better ui/user experience for the Advanced Settings dialog. affects windows platforms only. a=dveditz r=sgehani

This commit is contained in:
ssu%netscape.com 2000-08-22 00:45:10 +00:00
Родитель b24aa12d65
Коммит 47a9a81cdf
9 изменённых файлов: 301 добавлений и 69 удалений

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

@ -1700,9 +1700,73 @@ LRESULT CALLBACK DlgProcProgramFolder(HWND hDlg, UINT msg, WPARAM wParam, LONG l
return(0); return(0);
} }
LRESULT CALLBACK DlgAdvancedSettings(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam) LRESULT CALLBACK DlgProcAdvancedSettings(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
{ {
RECT rDlg; RECT rDlg;
switch(msg)
{
case WM_INITDIALOG:
SetWindowText(hDlg, diAdvancedSettings.szTitle);
SetDlgItemText(hDlg, IDC_MESSAGE0, diAdvancedSettings.szMessage0);
SetDlgItemText(hDlg, IDC_EDIT_PROXY_SERVER, diAdvancedSettings.szProxyServer);
SetDlgItemText(hDlg, IDC_EDIT_PROXY_PORT, diAdvancedSettings.szProxyPort);
if(GetClientRect(hDlg, &rDlg))
SetWindowPos(hDlg, HWND_TOP, (dwScreenX/2)-(rDlg.right/2), (dwScreenY/2)-(rDlg.bottom/2), 0, 0, SWP_NOSIZE);
break;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDWIZNEXT:
dwWizardState = DLG_ADVANCED_SETTINGS;
/* 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);
DestroyWindow(hDlg);
PostMessage(hWndMain, WM_COMMAND, IDWIZNEXT, 0);
break;
case IDWIZBACK:
DestroyWindow(hDlg);
PostMessage(hWndMain, WM_COMMAND, IDWIZBACK, 0);
break;
case IDCANCEL:
AskCancelDlg(hDlg);
break;
default:
break;
}
break;
}
return(0);
}
void SaveDownloadOptions(HWND hDlg, HWND hwndCBSiteSelector)
{
int iIndex;
/* get selected item from the site selector's pull down list */
iIndex = SendMessage(hwndCBSiteSelector, CB_GETCURSEL, 0, 0);
SendMessage(hwndCBSiteSelector, CB_GETLBTEXT, (WPARAM)iIndex, (LPARAM)szSiteSelectorDescription);
/* get the state of the Save Installer Files checkbox */
if(IsDlgButtonChecked(hDlg, IDC_CHECK_SAVE_INSTALLER_FILES) == BST_CHECKED)
diDownloadOptions.bSaveInstaller = TRUE;
else
diDownloadOptions.bSaveInstaller = FALSE;
}
LRESULT CALLBACK DlgProcDownloadOptions(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
{
RECT rDlg;
char szBuf[MAX_BUF];
HWND hwndCBSiteSelector; HWND hwndCBSiteSelector;
int iIndex; int iIndex;
ssi *ssiTemp; ssi *ssiTemp;
@ -1713,11 +1777,13 @@ LRESULT CALLBACK DlgAdvancedSettings(HWND hDlg, UINT msg, WPARAM wParam, LONG lP
switch(msg) switch(msg)
{ {
case WM_INITDIALOG: case WM_INITDIALOG:
SetWindowText(hDlg, diAdvancedSettings.szTitle); SetWindowText(hDlg, diDownloadOptions.szTitle);
SetDlgItemText(hDlg, IDC_MESSAGE0, diAdvancedSettings.szMessage0); SetDlgItemText(hDlg, IDC_MESSAGE0, diDownloadOptions.szMessage0);
SetDlgItemText(hDlg, IDC_MESSAGE1, diAdvancedSettings.szMessage1); SetDlgItemText(hDlg, IDC_MESSAGE1, diDownloadOptions.szMessage1);
SetDlgItemText(hDlg, IDC_EDIT_PROXY_SERVER, diAdvancedSettings.szProxyServer); SetDlgItemText(hDlg, IDC_MESSAGE2, diDownloadOptions.szMessage2);
SetDlgItemText(hDlg, IDC_EDIT_PROXY_PORT, diAdvancedSettings.szProxyPort);
GetSaveInstallerPath(szBuf, sizeof(szBuf));
SetDlgItemText(hDlg, IDC_EDIT_LOCAL_INSTALLER_PATH, szBuf);
if(GetClientRect(hDlg, &rDlg)) if(GetClientRect(hDlg, &rDlg))
SetWindowPos(hDlg, HWND_TOP, (dwScreenX/2)-(rDlg.right/2), (dwScreenY/2)-(rDlg.bottom/2), 0, 0, SWP_NOSIZE); SetWindowPos(hDlg, HWND_TOP, (dwScreenX/2)-(rDlg.right/2), (dwScreenY/2)-(rDlg.bottom/2), 0, 0, SWP_NOSIZE);
@ -1745,7 +1811,7 @@ LRESULT CALLBACK DlgAdvancedSettings(HWND hDlg, UINT msg, WPARAM wParam, LONG lP
else else
SendMessage(hwndCBSiteSelector, CB_SETCURSEL, 0, 0); SendMessage(hwndCBSiteSelector, CB_SETCURSEL, 0, 0);
if(diAdvancedSettings.bSaveInstaller) if(diDownloadOptions.bSaveInstaller)
CheckDlgButton(hDlg, IDC_CHECK_SAVE_INSTALLER_FILES, BST_CHECKED); CheckDlgButton(hDlg, IDC_CHECK_SAVE_INSTALLER_FILES, BST_CHECKED);
else else
CheckDlgButton(hDlg, IDC_CHECK_SAVE_INSTALLER_FILES, BST_UNCHECKED); CheckDlgButton(hDlg, IDC_CHECK_SAVE_INSTALLER_FILES, BST_UNCHECKED);
@ -1755,32 +1821,24 @@ LRESULT CALLBACK DlgAdvancedSettings(HWND hDlg, UINT msg, WPARAM wParam, LONG lP
switch(LOWORD(wParam)) switch(LOWORD(wParam))
{ {
case IDWIZNEXT: case IDWIZNEXT:
/* get selected item from the site selector's pull down list */ SaveDownloadOptions(hDlg, hwndCBSiteSelector);
iIndex = SendMessage(hwndCBSiteSelector, CB_GETCURSEL, 0, 0);
SendMessage(hwndCBSiteSelector, CB_GETLBTEXT, (WPARAM)iIndex, (LPARAM)szSiteSelectorDescription);
dwWizardState = DLG_ADVANCED_SETTINGS;
/* get the state of the Save Installer Files checkbox */
if(IsDlgButtonChecked(hDlg, IDC_CHECK_SAVE_INSTALLER_FILES) == BST_CHECKED)
diAdvancedSettings.bSaveInstaller = TRUE;
else
diAdvancedSettings.bSaveInstaller = FALSE;
/* 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);
DestroyWindow(hDlg); DestroyWindow(hDlg);
PostMessage(hWndMain, WM_COMMAND, IDWIZNEXT, 0); PostMessage(hWndMain, WM_COMMAND, IDWIZNEXT, 0);
break; break;
case IDWIZBACK: case IDWIZBACK:
iIndex = SendMessage(hwndCBSiteSelector, CB_GETCURSEL, 0, 0); SaveDownloadOptions(hDlg, hwndCBSiteSelector);
SendMessage(hwndCBSiteSelector, CB_GETLBTEXT, (WPARAM)iIndex, (LPARAM)szSiteSelectorDescription);
DestroyWindow(hDlg); DestroyWindow(hDlg);
PostMessage(hWndMain, WM_COMMAND, IDWIZBACK, 0); PostMessage(hWndMain, WM_COMMAND, IDWIZBACK, 0);
break; break;
case IDC_BUTTON_ADDITIONAL_SETTINGS:
SaveDownloadOptions(hDlg, hwndCBSiteSelector);
dwWizardState = DLG_PROGRAM_FOLDER;
DestroyWindow(hDlg);
PostMessage(hWndMain, WM_COMMAND, IDWIZNEXT, 0);
break;
case IDCANCEL: case IDCANCEL:
AskCancelDlg(hDlg); AskCancelDlg(hDlg);
break; break;
@ -1883,9 +1941,40 @@ LPSTR GetStartInstallMessage()
dwBufSize += lstrlen(szBuf) + 2; // the extra 2 bytes is for the \r\n characters dwBufSize += lstrlen(szBuf) + 2; // the extra 2 bytes is for the \r\n characters
dwBufSize += 4; // take into account 4 indentation spaces dwBufSize += 4; // take into account 4 indentation spaces
dwBufSize += lstrlen(sgProduct.szProgramFolderName) + 2; // the extra 2 bytes is for the \r\n characters dwBufSize += lstrlen(sgProduct.szProgramFolderName) + 2; // the extra 2 bytes is for the \r\n\r\n characters
if(GetTotalArchivesToDownload() > 0)
{
dwBufSize += 2; // the extra 2 bytes is for the \r\n characters
/* site selector info */
if(NS_LoadString(hSetupRscInst, IDS_STR_DOWNLOAD_SITE, szBuf, MAX_BUF) == WIZ_OK)
dwBufSize += lstrlen(szBuf) + 2; // the extra 2 bytes is for the \r\n characters
dwBufSize += 4; // take into account 4 indentation spaces
dwBufSize += lstrlen(szSiteSelectorDescription) + 2; // the extra 2 bytes is for the \r\n characters
if(diDownloadOptions.bSaveInstaller)
{
dwBufSize += 2; // the extra 2 bytes is for the \r\n characters
/* site selector info */
if(NS_LoadString(hSetupRscInst, IDS_STR_SAVE_INSTALLER_FILES, szBuf, MAX_BUF) == WIZ_OK)
dwBufSize += lstrlen(szBuf) + 2; // the extra 2 bytes is for the \r\n characters
GetSaveInstallerPath(szBuf, sizeof(szBuf));
dwBufSize += 4; // take into account 4 indentation spaces
dwBufSize += lstrlen(szBuf) + 2; // the extra 2 bytes is for the \r\n characters
}
}
dwBufSize += 1; // take into account the null character dwBufSize += 1; // take into account the null character
/* From here down, the buffer is created given the above calculated buffer size. If the
* string concatenation (addition) is changed below, then the buffer size calculation above
* needs to be changed accordingly! */
/* allocate the memory */ /* allocate the memory */
if((szMessageBuf = NS_GlobalAlloc(dwBufSize)) != NULL) if((szMessageBuf = NS_GlobalAlloc(dwBufSize)) != NULL)
{ {
@ -1961,6 +2050,39 @@ LPSTR GetStartInstallMessage()
lstrcat(szMessageBuf, " "); // add 4 indentation spaces lstrcat(szMessageBuf, " "); // add 4 indentation spaces
lstrcat(szMessageBuf, sgProduct.szProgramFolderName); lstrcat(szMessageBuf, sgProduct.szProgramFolderName);
lstrcat(szMessageBuf, "\r\n"); lstrcat(szMessageBuf, "\r\n");
if(GetTotalArchivesToDownload() > 0)
{
lstrcat(szMessageBuf, "\r\n");
/* site selector info */
if(NS_LoadString(hSetupRscInst, IDS_STR_DOWNLOAD_SITE, szBuf, MAX_BUF) == WIZ_OK)
{
lstrcat(szMessageBuf, szBuf);
lstrcat(szMessageBuf, "\r\n");
}
lstrcat(szMessageBuf, " "); // add 4 indentation spaces
lstrcat(szMessageBuf, szSiteSelectorDescription); // site selector description
lstrcat(szMessageBuf, "\r\n");
if(diDownloadOptions.bSaveInstaller)
{
lstrcat(szMessageBuf, "\r\n");
/* site selector info */
if(NS_LoadString(hSetupRscInst, IDS_STR_SAVE_INSTALLER_FILES, szBuf, MAX_BUF) == WIZ_OK)
{
lstrcat(szMessageBuf, szBuf);
lstrcat(szMessageBuf, "\r\n");
}
GetSaveInstallerPath(szBuf, sizeof(szBuf));
lstrcat(szMessageBuf, " "); // add 4 indentation spaces
lstrcat(szMessageBuf, szBuf);
lstrcat(szMessageBuf, "\r\n");
}
}
} }
return(szMessageBuf); return(szMessageBuf);
@ -2295,7 +2417,7 @@ void DlgSequenceNext()
dwWizardState = DLG_ADVANCED_SETTINGS; dwWizardState = DLG_ADVANCED_SETTINGS;
gbProcessingXpnstallFiles = FALSE; gbProcessingXpnstallFiles = FALSE;
if(diAdvancedSettings.bShowDialog) if(diAdvancedSettings.bShowDialog)
hDlgCurrent = InstantiateDialog(hWndMain, dwWizardState, diAdvancedSettings.szTitle, DlgAdvancedSettings); hDlgCurrent = InstantiateDialog(hWndMain, dwWizardState, diAdvancedSettings.szTitle, DlgProcAdvancedSettings);
else else
{ {
dwWizardState = DLG_ADVANCED_SETTINGS; dwWizardState = DLG_ADVANCED_SETTINGS;
@ -2304,8 +2426,9 @@ void DlgSequenceNext()
break; break;
case DLG_ADVANCED_SETTINGS: case DLG_ADVANCED_SETTINGS:
dwWizardState = DLG_START_INSTALL; dwWizardState = DLG_DOWNLOAD_OPTIONS;
gbProcessingXpnstallFiles = FALSE; gbProcessingXpnstallFiles = FALSE;
do do
{ {
hrValue = VerifyDiskSpace(); hrValue = VerifyDiskSpace();
@ -2329,6 +2452,18 @@ void DlgSequenceNext()
break; break;
} }
if((diDownloadOptions.bShowDialog == TRUE) && (GetTotalArchivesToDownload() > 0))
hDlgCurrent = InstantiateDialog(hWndMain, dwWizardState, diDownloadOptions.szTitle, DlgProcDownloadOptions);
else
{
dwWizardState = DLG_DOWNLOAD_OPTIONS;
PostMessage(hWndMain, WM_COMMAND, IDWIZNEXT, 0);
}
break;
case DLG_DOWNLOAD_OPTIONS:
dwWizardState = DLG_START_INSTALL;
gbProcessingXpnstallFiles = FALSE;
if(diStartInstall.bShowDialog) if(diStartInstall.bShowDialog)
hDlgCurrent = InstantiateDialog(hWndMain, dwWizardState, diStartInstall.szTitle, DlgProcStartInstall); hDlgCurrent = InstantiateDialog(hWndMain, dwWizardState, diStartInstall.szTitle, DlgProcStartInstall);
else else
@ -2359,7 +2494,7 @@ void DlgSequenceNext()
if(CheckInstances()) if(CheckInstances())
{ {
/* save the installer files in the local machine */ /* save the installer files in the local machine */
if(diAdvancedSettings.bSaveInstaller) if(diDownloadOptions.bSaveInstaller)
SaveInstallerFiles(); SaveInstallerFiles();
CleanupXpcomFile(); CleanupXpcomFile();
@ -2392,7 +2527,7 @@ void DlgSequenceNext()
CreateDirectoriesAll(szBuf, TRUE); CreateDirectoriesAll(szBuf, TRUE);
/* save the installer files in the local machine */ /* save the installer files in the local machine */
if(diAdvancedSettings.bSaveInstaller) if(diDownloadOptions.bSaveInstaller)
SaveInstallerFiles(); SaveInstallerFiles();
hrErr = SmartUpdateJars(); hrErr = SmartUpdateJars();
@ -2452,12 +2587,21 @@ void DlgSequencePrev()
dwWizardState = DLG_ADVANCED_SETTINGS; dwWizardState = DLG_ADVANCED_SETTINGS;
gbProcessingXpnstallFiles = FALSE; gbProcessingXpnstallFiles = FALSE;
if(diAdvancedSettings.bShowDialog) if(diAdvancedSettings.bShowDialog)
hDlgCurrent = InstantiateDialog(hWndMain, dwWizardState, diAdvancedSettings.szTitle, DlgAdvancedSettings); hDlgCurrent = InstantiateDialog(hWndMain, dwWizardState, diAdvancedSettings.szTitle, DlgProcAdvancedSettings);
else else
PostMessage(hWndMain, WM_COMMAND, IDWIZBACK, 0); PostMessage(hWndMain, WM_COMMAND, IDWIZBACK, 0);
break; break;
case DLG_ADVANCED_SETTINGS: case DLG_ADVANCED_SETTINGS:
dwWizardState = DLG_DOWNLOAD_OPTIONS;
gbProcessingXpnstallFiles = FALSE;
if((diDownloadOptions.bShowDialog == TRUE) && (GetTotalArchivesToDownload() > 0))
hDlgCurrent = InstantiateDialog(hWndMain, dwWizardState, diDownloadOptions.szTitle, DlgProcDownloadOptions);
else
PostMessage(hWndMain, WM_COMMAND, IDWIZBACK, 0);
break;
case DLG_DOWNLOAD_OPTIONS:
dwWizardState = DLG_PROGRAM_FOLDER; dwWizardState = DLG_PROGRAM_FOLDER;
gbProcessingXpnstallFiles = FALSE; gbProcessingXpnstallFiles = FALSE;
if(CheckWizardStateCustom(DLG_SELECT_COMPONENTS)) if(CheckWizardStateCustom(DLG_SELECT_COMPONENTS))

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

@ -33,6 +33,8 @@ LRESULT CALLBACK DlgProcSelectComponents(HWND hDlg, UINT msg, WPARAM wParam, LO
LRESULT CALLBACK DlgProcSelectAdditionalComponents(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 DlgProcWindowsIntegration(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcProgramFolder(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam); LRESULT CALLBACK DlgProcProgramFolder(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcDownloadOptions(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcAdvancedSettings(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcSiteSelector(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam); LRESULT CALLBACK DlgProcSiteSelector(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcStartInstall(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam); LRESULT CALLBACK DlgProcStartInstall(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcReboot(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam); LRESULT CALLBACK DlgProcReboot(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
@ -58,6 +60,7 @@ void SunJavaDependencyHack(DWORD dwIndex, BOOL bSelected, DWORD dwA
LPSTR GetStartInstallMessage(void); LPSTR GetStartInstallMessage(void);
void AppendStringWOAmpersand(LPSTR szInputString, DWORD dwInputStringSize, LPSTR szString); void AppendStringWOAmpersand(LPSTR szInputString, DWORD dwInputStringSize, LPSTR szString);
void TruncateString(HWND hWnd, LPSTR szInPath, DWORD dwInPathBufSize, LPSTR szOutPath, DWORD dwOutPathBufSize); void TruncateString(HWND hWnd, LPSTR szInPath, DWORD dwInPathBufSize, LPSTR szOutPath, DWORD dwOutPathBufSize);
void SaveDownloadOptions(HWND hDlg, HWND hwndCBSiteSelector);
WNDPROC SubclassWindow( HWND hWnd, WNDPROC NewWndProc); WNDPROC SubclassWindow( HWND hWnd, WNDPROC NewWndProc);
LRESULT CALLBACK ListBoxBrowseWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); LRESULT CALLBACK ListBoxBrowseWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);

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

@ -82,6 +82,7 @@ extern diSC diSelectComponents;
extern diSC diSelectAdditionalComponents; extern diSC diSelectAdditionalComponents;
extern diWI diWindowsIntegration; extern diWI diWindowsIntegration;
extern diPF diProgramFolder; extern diPF diProgramFolder;
extern diDO diDownloadOptions;
extern diAS diAdvancedSettings; extern diAS diAdvancedSettings;
extern diSI diStartInstall; extern diSI diStartInstall;
extern diR diReboot; extern diR diReboot;

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

@ -1739,16 +1739,37 @@ void DeInitDlgProgramFolder(diPF *diDialog)
FreeMemory(&(diDialog->szMessage0)); FreeMemory(&(diDialog->szMessage0));
} }
HRESULT InitDlgAdvancedSettings(diAS *diDialog) HRESULT InitDlgDownloadOptions(diDO *diDialog)
{ {
diDialog->bShowDialog = FALSE; diDialog->bShowDialog = FALSE;
diDialog->bSaveInstaller = FALSE; diDialog->bSaveInstaller = FALSE;
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)
return(1); return(1);
if((diDialog->szMessage1 = NS_GlobalAlloc(MAX_BUF)) == NULL) if((diDialog->szMessage1 = NS_GlobalAlloc(MAX_BUF)) == NULL)
return(1); return(1);
if((diDialog->szMessage2 = NS_GlobalAlloc(MAX_BUF)) == NULL)
return(1);
return(0);
}
void DeInitDlgDownloadOptions(diDO *diDialog)
{
FreeMemory(&(diDialog->szTitle));
FreeMemory(&(diDialog->szMessage0));
FreeMemory(&(diDialog->szMessage1));
FreeMemory(&(diDialog->szMessage2));
}
HRESULT InitDlgAdvancedSettings(diAS *diDialog)
{
diDialog->bShowDialog = FALSE;
if((diDialog->szTitle = NS_GlobalAlloc(MAX_BUF)) == NULL)
return(1);
if((diDialog->szMessage0 = NS_GlobalAlloc(MAX_BUF)) == NULL)
return(1);
if((diDialog->szProxyServer = NS_GlobalAlloc(MAX_BUF)) == NULL) if((diDialog->szProxyServer = NS_GlobalAlloc(MAX_BUF)) == NULL)
return(1); return(1);
if((diDialog->szProxyPort = NS_GlobalAlloc(MAX_BUF)) == NULL) if((diDialog->szProxyPort = NS_GlobalAlloc(MAX_BUF)) == NULL)
@ -1761,7 +1782,6 @@ void DeInitDlgAdvancedSettings(diAS *diDialog)
{ {
FreeMemory(&(diDialog->szTitle)); FreeMemory(&(diDialog->szTitle));
FreeMemory(&(diDialog->szMessage0)); FreeMemory(&(diDialog->szMessage0));
FreeMemory(&(diDialog->szMessage1));
FreeMemory(&(diDialog->szProxyServer)); FreeMemory(&(diDialog->szProxyServer));
FreeMemory(&(diDialog->szProxyPort)); FreeMemory(&(diDialog->szProxyPort));
} }
@ -4026,6 +4046,8 @@ HRESULT ParseConfigIni(LPSTR lpszCmdLine)
return(1); return(1);
if(InitDlgProgramFolder(&diProgramFolder)) if(InitDlgProgramFolder(&diProgramFolder))
return(1); return(1);
if(InitDlgDownloadOptions(&diDownloadOptions))
return(1);
if(InitDlgAdvancedSettings(&diAdvancedSettings)) if(InitDlgAdvancedSettings(&diAdvancedSettings))
return(1); return(1);
if(InitDlgStartInstall(&diStartInstall)) if(InitDlgStartInstall(&diStartInstall))
@ -4253,16 +4275,24 @@ HRESULT ParseConfigIni(LPSTR lpszCmdLine)
if(lstrcmpi(szShowDialog, "TRUE") == 0) if(lstrcmpi(szShowDialog, "TRUE") == 0)
diProgramFolder.bShowDialog = TRUE; diProgramFolder.bShowDialog = TRUE;
/* Download Options dialog */
GetPrivateProfileString("Dialog Download Options", "Show Dialog", "", szShowDialog, MAX_BUF, szFileIniConfig);
GetPrivateProfileString("Dialog Download Options", "Title", "", diDownloadOptions.szTitle, MAX_BUF, szFileIniConfig);
GetPrivateProfileString("Dialog Download Options", "Message0", "", diDownloadOptions.szMessage0, MAX_BUF, szFileIniConfig);
GetPrivateProfileString("Dialog Download Options", "Message1", "", diDownloadOptions.szMessage1, MAX_BUF, szFileIniConfig);
GetPrivateProfileString("Dialog Download Options", "Message2", "", diDownloadOptions.szMessage2, MAX_BUF, szFileIniConfig);
GetPrivateProfileString("Dialog Download Options", "Save Installer", "", szBuf, MAX_BUF, szFileIniConfig);
if(lstrcmpi(szBuf, "TRUE") == 0)
diDownloadOptions.bSaveInstaller = TRUE;
if(lstrcmpi(szShowDialog, "TRUE") == 0)
diDownloadOptions.bShowDialog = TRUE;
/* Advanced Settings dialog */ /* Advanced Settings dialog */
GetPrivateProfileString("Dialog Advanced Settings", "Show Dialog", "", szShowDialog, MAX_BUF, szFileIniConfig); GetPrivateProfileString("Dialog Advanced Settings", "Show Dialog", "", szShowDialog, MAX_BUF, szFileIniConfig);
GetPrivateProfileString("Dialog Advanced Settings", "Title", "", diAdvancedSettings.szTitle, MAX_BUF, szFileIniConfig); GetPrivateProfileString("Dialog Advanced Settings", "Title", "", diAdvancedSettings.szTitle, MAX_BUF, szFileIniConfig);
GetPrivateProfileString("Dialog Advanced Settings", "Message0", "", diAdvancedSettings.szMessage0, MAX_BUF, szFileIniConfig); GetPrivateProfileString("Dialog Advanced Settings", "Message0", "", diAdvancedSettings.szMessage0, MAX_BUF, szFileIniConfig);
GetPrivateProfileString("Dialog Advanced Settings", "Message1", "", diAdvancedSettings.szMessage1, MAX_BUF, szFileIniConfig);
GetPrivateProfileString("Dialog Advanced Settings", "Proxy Server", "", diAdvancedSettings.szProxyServer, MAX_BUF, szFileIniConfig); GetPrivateProfileString("Dialog Advanced Settings", "Proxy Server", "", diAdvancedSettings.szProxyServer, MAX_BUF, szFileIniConfig);
GetPrivateProfileString("Dialog Advanced Settings", "Proxy Port", "", diAdvancedSettings.szProxyPort, MAX_BUF, szFileIniConfig); GetPrivateProfileString("Dialog Advanced Settings", "Proxy Port", "", diAdvancedSettings.szProxyPort, MAX_BUF, szFileIniConfig);
GetPrivateProfileString("Dialog Advanced Settings", "Save Installer", "", szBuf, MAX_BUF, szFileIniConfig);
if(lstrcmpi(szBuf, "TRUE") == 0)
diAdvancedSettings.bSaveInstaller = TRUE;
if(lstrcmpi(szShowDialog, "TRUE") == 0) if(lstrcmpi(szShowDialog, "TRUE") == 0)
diAdvancedSettings.bShowDialog = TRUE; diAdvancedSettings.bShowDialog = TRUE;
@ -4332,6 +4362,7 @@ HRESULT ParseConfigIni(LPSTR lpszCmdLine)
diSelectAdditionalComponents.bShowDialog = FALSE; diSelectAdditionalComponents.bShowDialog = FALSE;
diWindowsIntegration.bShowDialog = FALSE; diWindowsIntegration.bShowDialog = FALSE;
diProgramFolder.bShowDialog = FALSE; diProgramFolder.bShowDialog = FALSE;
diDownloadOptions.bShowDialog = FALSE;
diAdvancedSettings.bShowDialog = FALSE; diAdvancedSettings.bShowDialog = FALSE;
diStartInstall.bShowDialog = FALSE; diStartInstall.bShowDialog = FALSE;
break; break;
@ -5436,6 +5467,7 @@ void DeInitialize()
DeInitSDObject(); DeInitSDObject();
DeInitDlgReboot(&diReboot); DeInitDlgReboot(&diReboot);
DeInitDlgStartInstall(&diStartInstall); DeInitDlgStartInstall(&diStartInstall);
DeInitDlgDownloadOptions(&diDownloadOptions);
DeInitDlgAdvancedSettings(&diAdvancedSettings); DeInitDlgAdvancedSettings(&diAdvancedSettings);
DeInitDlgProgramFolder(&diProgramFolder); DeInitDlgProgramFolder(&diProgramFolder);
DeInitDlgWindowsIntegration(&diWindowsIntegration); DeInitDlgWindowsIntegration(&diWindowsIntegration);
@ -5459,6 +5491,27 @@ void DeInitialize()
DeInitializeSmartDownload(); DeInitializeSmartDownload();
} }
char *GetSaveInstallerPath(char *szBuf, DWORD dwBufSize)
{
char szBuf2[MAX_BUF];
/* determine the path to where the setup and downloaded files will be saved to */
lstrcpy(szBuf, sgProduct.szPath);
AppendBackSlash(szBuf, dwBufSize);
if(*sgProduct.szSubPath != '\0')
{
lstrcat(szBuf, sgProduct.szSubPath);
lstrcat(szBuf, " ");
}
if(NS_LoadString(hSetupRscInst, IDS_STR_SETUP, szBuf2, MAX_BUF) == WIZ_OK)
lstrcat(szBuf, szBuf2);
else
lstrcat(szBuf, "Setup");
return(szBuf);
}
void SaveInstallerFiles() void SaveInstallerFiles()
{ {
int i; int i;
@ -5470,14 +5523,7 @@ void SaveInstallerFiles()
DWORD dwIndex0; DWORD dwIndex0;
siC *siCObject = NULL; siC *siCObject = NULL;
lstrcpy(szDestination, sgProduct.szPath); GetSaveInstallerPath(szDestination, sizeof(szDestination));
AppendBackSlash(szDestination, sizeof(szDestination));
if(*sgProduct.szSubPath != '\0')
{
lstrcat(szDestination, sgProduct.szSubPath);
AppendBackSlash(szDestination, sizeof(szDestination));
}
lstrcat(szDestination, "Install");
AppendBackSlash(szDestination, sizeof(szDestination)); AppendBackSlash(szDestination, sizeof(szDestination));
/* copy all files from the ns_temp dir to the install dir */ /* copy all files from the ns_temp dir to the install dir */

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

@ -174,6 +174,7 @@ void SetSetupRunMode(LPSTR szMode);
void Delay(DWORD dwSeconds); void Delay(DWORD dwSeconds);
siCD *InitWinInitNodes(char *szInFile); siCD *InitWinInitNodes(char *szInFile);
void UpdateWininit(LPSTR szUninstallFilename); void UpdateWininit(LPSTR szUninstallFilename);
char *GetSaveInstallerPath(char *szBuf, DWORD dwBufSize);
void SaveInstallerFiles(void); void SaveInstallerFiles(void);
void ResetComponentAttributes(char *szFileIni); void ResetComponentAttributes(char *szFileIni);
BOOL IsInList(DWORD dwCurrentItem, DWORD dwItems, DWORD *dwItemsSelected); BOOL IsInList(DWORD dwCurrentItem, DWORD dwItems, DWORD *dwItemsSelected);

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

@ -82,6 +82,7 @@ diSC diSelectComponents;
diSC diSelectAdditionalComponents; diSC diSelectAdditionalComponents;
diWI diWindowsIntegration; diWI diWindowsIntegration;
diPF diProgramFolder; diPF diProgramFolder;
diDO diDownloadOptions;
diAS diAdvancedSettings; diAS diAdvancedSettings;
diSI diStartInstall; diSI diStartInstall;
diR diReboot; diR diReboot;

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

@ -237,15 +237,23 @@ typedef struct dlgProgramFolder
LPSTR szMessage0; LPSTR szMessage0;
} diPF; } diPF;
typedef struct dlgAdvancedSettings typedef struct dlgDownloadOptions
{ {
BOOL bShowDialog; BOOL bShowDialog;
LPSTR szTitle; LPSTR szTitle;
LPSTR szMessage0; LPSTR szMessage0;
LPSTR szMessage1; LPSTR szMessage1;
LPSTR szMessage2;
BOOL bSaveInstaller;
} diDO;
typedef struct dlgAdvancedSettings
{
BOOL bShowDialog;
LPSTR szTitle;
LPSTR szMessage0;
LPSTR szProxyServer; LPSTR szProxyServer;
LPSTR szProxyPort; LPSTR szProxyPort;
BOOL bSaveInstaller;
} diAS; } diAS;
typedef struct dlgStartInstall typedef struct dlgStartInstall

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

@ -100,6 +100,10 @@
#define IDC_EDIT_PROXY_PORT 1063 #define IDC_EDIT_PROXY_PORT 1063
#define IDC_TAB1 1064 #define IDC_TAB1 1064
#define IDC_DELETE_PATH 1065 #define IDC_DELETE_PATH 1065
#define IDC_LOCAL_INSTALLER_PATH 1066
#define IDC_EDIT_LOCAL_INSTALLER_PATH 1066
#define IDC_BUTTON_ADDITIONAL_SETTINGS 1067
#define IDC_BUTTON_PROXY_SETTINGS 1067
#define DLG_WELCOME 2001 #define DLG_WELCOME 2001
#define DLG_LICENSE 2002 #define DLG_LICENSE 2002
#define DLG_SETUP_TYPE 2003 #define DLG_SETUP_TYPE 2003
@ -115,6 +119,7 @@
#define DLG_ADVANCED_SETTINGS 10207 #define DLG_ADVANCED_SETTINGS 10207
#define DLG_SELECT_ADDITIONAL_COMPONENTS 10208 #define DLG_SELECT_ADDITIONAL_COMPONENTS 10208
#define DLG_UPGRADE 10209 #define DLG_UPGRADE 10209
#define DLG_DOWNLOAD_OPTIONS 10210
#define IDB_BOX_CHECKED 10304 #define IDB_BOX_CHECKED 10304
#define IDB_BOX_UNCHECKED 10306 #define IDB_BOX_UNCHECKED 10306
#define IDB_BOX_CHECKED_DISABLED 10307 #define IDB_BOX_CHECKED_DISABLED 10307
@ -130,6 +135,7 @@
#define IDWIZBACK 11013 #define IDWIZBACK 11013
#define IDWIZNEXT 11014 #define IDWIZNEXT 11014
#define IDS_MSG_CREATE_DIRECTORY 11015 #define IDS_MSG_CREATE_DIRECTORY 11015
#define IDWIZNEXT2 11015
#define IDS_STR_CREATE_DIRECTORY 11016 #define IDS_STR_CREATE_DIRECTORY 11016
#define IDS_ERROR_PROGRAM_FOLDER_NAME 11017 #define IDS_ERROR_PROGRAM_FOLDER_NAME 11017
#define IDS_CB_DEFAULT 11018 #define IDS_CB_DEFAULT 11018
@ -139,6 +145,9 @@
#define IDS_STR_DESTINATION_DIRECTORY 11022 #define IDS_STR_DESTINATION_DIRECTORY 11022
#define IDS_STR_PROGRAM_FOLDER 11023 #define IDS_STR_PROGRAM_FOLDER 11023
#define IDS_STR_DELETING_DESTINATION_DIR 11024 #define IDS_STR_DELETING_DESTINATION_DIR 11024
#define IDS_STR_SETUP 11025
#define IDS_STR_DOWNLOAD_SITE 11026
#define IDS_STR_SAVE_INSTALLER_FILES 11027
#define IDC_STATIC -1 #define IDC_STATIC -1
// Next default values for new objects // Next default values for new objects
@ -148,7 +157,7 @@
#define _APS_NO_MFC 1 #define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 112 #define _APS_NEXT_RESOURCE_VALUE 112
#define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1066 #define _APS_NEXT_CONTROL_VALUE 1070
#define _APS_NEXT_SYMED_VALUE 101 #define _APS_NEXT_SYMED_VALUE 101
#endif #endif
#endif #endif

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

@ -185,8 +185,6 @@ FONT 8, "MS Sans Serif"
BEGIN BEGIN
EDITTEXT IDC_CURRENT_SETTINGS,101,67,204,106,ES_MULTILINE | EDITTEXT IDC_CURRENT_SETTINGS,101,67,204,106,ES_MULTILINE |
ES_OEMCONVERT | ES_READONLY | WS_VSCROLL | WS_HSCROLL ES_OEMCONVERT | ES_READONLY | WS_VSCROLL | WS_HSCROLL
PUSHBUTTON "&Advanced Settings",IDC_BUTTON_SITE_SELECTOR,11,186,84,
14
PUSHBUTTON "< &Back",IDWIZBACK,134,186,53,14 PUSHBUTTON "< &Back",IDWIZBACK,134,186,53,14
DEFPUSHBUTTON "&Install",IDWIZNEXT,188,186,53,14 DEFPUSHBUTTON "&Install",IDWIZNEXT,188,186,53,14
PUSHBUTTON "&Cancel",IDCANCEL,252,186,53,14 PUSHBUTTON "&Cancel",IDCANCEL,252,186,53,14
@ -254,25 +252,18 @@ DLG_ADVANCED_SETTINGS DIALOG DISCARDABLE 51, 56, 315, 205
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif" FONT 8, "MS Sans Serif"
BEGIN BEGIN
COMBOBOX IDC_LIST_SITE_SELECTOR,101,49,206,124,CBS_DROPDOWNLIST | EDITTEXT IDC_EDIT_PROXY_SERVER,147,65,152,12,ES_AUTOHSCROLL
CBS_SORT | CBS_NOINTEGRALHEIGHT | WS_VSCROLL | EDITTEXT IDC_EDIT_PROXY_PORT,147,82,152,12,ES_AUTOHSCROLL
WS_TABSTOP
EDITTEXT IDC_EDIT_PROXY_SERVER,147,83,152,12,ES_AUTOHSCROLL
EDITTEXT IDC_EDIT_PROXY_PORT,147,100,152,12,ES_AUTOHSCROLL
CONTROL "Save installer files locally",
IDC_CHECK_SAVE_INSTALLER_FILES,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,101,159,204,9
DEFPUSHBUTTON "&Ok",IDWIZNEXT,188,186,53,14 DEFPUSHBUTTON "&Ok",IDWIZNEXT,188,186,53,14
PUSHBUTTON "&Cancel",IDCANCEL,252,186,53,14 PUSHBUTTON "&Cancel",IDCANCEL,252,186,53,14
LTEXT "",IDC_MESSAGE1,101,130,204,26,NOT WS_GROUP
CONTROL 108,IDC_STATIC,"Static",SS_BITMAP,11,11,80,160, CONTROL 108,IDC_STATIC,"Static",SS_BITMAP,11,11,80,160,
WS_EX_CLIENTEDGE WS_EX_CLIENTEDGE
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1, CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE WS_EX_STATICEDGE
LTEXT "",IDC_MESSAGE0,101,11,204,33,NOT WS_GROUP RTEXT "Server:",IDC_STATIC,108,67,35,9
RTEXT "Server:",IDC_STATIC,108,85,35,9 RTEXT "Port:",IDC_STATIC,108,83,35,9
RTEXT "Port:",IDC_STATIC,108,101,35,9 GROUPBOX "Proxy Settings:",IDC_STATIC,101,52,206,51
GROUPBOX "Proxy Settings:",IDC_STATIC,101,70,206,51 LTEXT "",IDC_MESSAGE0,101,11,204,37,NOT WS_GROUP
END END
DLG_SELECT_ADDITIONAL_COMPONENTS DIALOG DISCARDABLE 51, 56, 315, 205 DLG_SELECT_ADDITIONAL_COMPONENTS DIALOG DISCARDABLE 51, 56, 315, 205
@ -305,13 +296,38 @@ DLG_UPGRADE DIALOG DISCARDABLE 51, 56, 310, 166
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION
FONT 8, "MS Sans Serif" FONT 8, "MS Sans Serif"
BEGIN BEGIN
DEFPUSHBUTTON "&Back",IDWIZBACK,162,139,53,14
PUSHBUTTON "&Delete",ID_DELETE,95,139,53,14
LTEXT "",IDC_MESSAGE0,17,13,276,31,NOT WS_GROUP LTEXT "",IDC_MESSAGE0,17,13,276,31,NOT WS_GROUP
LTEXT "",IDC_MESSAGE1,17,48,276,21,NOT WS_GROUP LTEXT "",IDC_MESSAGE1,17,48,276,21,NOT WS_GROUP
LTEXT "",IDC_DELETE_PATH,22,111,264,13,SS_CENTERIMAGE
GROUPBOX "Destination Directory",IDC_STATIC,16,102,276,25
LTEXT "",IDC_MESSAGE2,17,73,276,21,NOT WS_GROUP LTEXT "",IDC_MESSAGE2,17,73,276,21,NOT WS_GROUP
GROUPBOX "Destination Directory",IDC_STATIC,16,102,276,25
LTEXT "",IDC_DELETE_PATH,22,111,264,13,SS_CENTERIMAGE
PUSHBUTTON "&Delete",ID_DELETE,95,139,53,14
DEFPUSHBUTTON "&Back",IDWIZBACK,162,139,53,14
END
DLG_DOWNLOAD_OPTIONS DIALOG DISCARDABLE 51, 56, 315, 205
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "",IDC_MESSAGE2,101,91,204,33,NOT WS_GROUP
CONTROL "Save installer files locally",
IDC_CHECK_SAVE_INSTALLER_FILES,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,101,127,204,9
EDITTEXT IDC_EDIT_LOCAL_INSTALLER_PATH,101,140,204,12,
ES_AUTOHSCROLL | ES_READONLY
PUSHBUTTON "&Proxy Settings",IDC_BUTTON_PROXY_SETTINGS,221,159,84,
14
PUSHBUTTON "< &Back",IDWIZBACK,134,186,53,14
DEFPUSHBUTTON "&Next >",IDWIZNEXT,188,186,53,14
PUSHBUTTON "&Cancel",IDCANCEL,252,186,53,14
CONTROL 108,-1,"Static",SS_BITMAP,11,11,80,160,WS_EX_CLIENTEDGE
CONTROL "",-1,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE
COMBOBOX IDC_LIST_SITE_SELECTOR,101,66,206,124,CBS_DROPDOWNLIST |
CBS_SORT | CBS_NOINTEGRALHEIGHT | WS_VSCROLL |
WS_TABSTOP
LTEXT "",IDC_MESSAGE1,101,36,204,25,NOT WS_GROUP
LTEXT "",IDC_MESSAGE0,101,11,204,16,NOT WS_GROUP
END END
@ -424,6 +440,9 @@ STRINGTABLE DISCARDABLE
BEGIN BEGIN
IDS_STR_DELETING_DESTINATION_DIR IDS_STR_DELETING_DESTINATION_DIR
"Deleting destination directory to be able to upgrade, please wait..." "Deleting destination directory to be able to upgrade, please wait..."
IDS_STR_SETUP "Setup"
IDS_STR_DOWNLOAD_SITE "Download Site:"
IDS_STR_SAVE_INSTALLER_FILES "Save downloaded and Setup program files to:"
END END
#endif // English (U.S.) resources #endif // English (U.S.) resources