diff --git a/xpinstall/wizard/windows/setup/dialogs.c b/xpinstall/wizard/windows/setup/dialogs.c index 76e4e10b348..dea772fb1bc 100644 --- a/xpinstall/wizard/windows/setup/dialogs.c +++ b/xpinstall/wizard/windows/setup/dialogs.c @@ -1700,9 +1700,73 @@ LRESULT CALLBACK DlgProcProgramFolder(HWND hDlg, UINT msg, WPARAM wParam, LONG l 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; + + 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; int iIndex; ssi *ssiTemp; @@ -1713,11 +1777,13 @@ LRESULT CALLBACK DlgAdvancedSettings(HWND hDlg, UINT msg, WPARAM wParam, LONG lP switch(msg) { case WM_INITDIALOG: - SetWindowText(hDlg, diAdvancedSettings.szTitle); - SetDlgItemText(hDlg, IDC_MESSAGE0, diAdvancedSettings.szMessage0); - SetDlgItemText(hDlg, IDC_MESSAGE1, diAdvancedSettings.szMessage1); - SetDlgItemText(hDlg, IDC_EDIT_PROXY_SERVER, diAdvancedSettings.szProxyServer); - SetDlgItemText(hDlg, IDC_EDIT_PROXY_PORT, diAdvancedSettings.szProxyPort); + SetWindowText(hDlg, diDownloadOptions.szTitle); + SetDlgItemText(hDlg, IDC_MESSAGE0, diDownloadOptions.szMessage0); + SetDlgItemText(hDlg, IDC_MESSAGE1, diDownloadOptions.szMessage1); + SetDlgItemText(hDlg, IDC_MESSAGE2, diDownloadOptions.szMessage2); + + GetSaveInstallerPath(szBuf, sizeof(szBuf)); + SetDlgItemText(hDlg, IDC_EDIT_LOCAL_INSTALLER_PATH, szBuf); if(GetClientRect(hDlg, &rDlg)) 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 SendMessage(hwndCBSiteSelector, CB_SETCURSEL, 0, 0); - if(diAdvancedSettings.bSaveInstaller) + if(diDownloadOptions.bSaveInstaller) CheckDlgButton(hDlg, IDC_CHECK_SAVE_INSTALLER_FILES, BST_CHECKED); else 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)) { case IDWIZNEXT: - /* 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); - 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); - + SaveDownloadOptions(hDlg, hwndCBSiteSelector); DestroyWindow(hDlg); PostMessage(hWndMain, WM_COMMAND, IDWIZNEXT, 0); break; case IDWIZBACK: - iIndex = SendMessage(hwndCBSiteSelector, CB_GETCURSEL, 0, 0); - SendMessage(hwndCBSiteSelector, CB_GETLBTEXT, (WPARAM)iIndex, (LPARAM)szSiteSelectorDescription); + SaveDownloadOptions(hDlg, hwndCBSiteSelector); DestroyWindow(hDlg); PostMessage(hWndMain, WM_COMMAND, IDWIZBACK, 0); break; + case IDC_BUTTON_ADDITIONAL_SETTINGS: + SaveDownloadOptions(hDlg, hwndCBSiteSelector); + dwWizardState = DLG_PROGRAM_FOLDER; + DestroyWindow(hDlg); + PostMessage(hWndMain, WM_COMMAND, IDWIZNEXT, 0); + break; + case IDCANCEL: AskCancelDlg(hDlg); break; @@ -1883,9 +1941,40 @@ LPSTR GetStartInstallMessage() dwBufSize += lstrlen(szBuf) + 2; // the extra 2 bytes is for the \r\n characters 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 + + /* 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 */ if((szMessageBuf = NS_GlobalAlloc(dwBufSize)) != NULL) { @@ -1961,6 +2050,39 @@ LPSTR GetStartInstallMessage() lstrcat(szMessageBuf, " "); // add 4 indentation spaces lstrcat(szMessageBuf, sgProduct.szProgramFolderName); 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); @@ -2295,7 +2417,7 @@ void DlgSequenceNext() dwWizardState = DLG_ADVANCED_SETTINGS; gbProcessingXpnstallFiles = FALSE; if(diAdvancedSettings.bShowDialog) - hDlgCurrent = InstantiateDialog(hWndMain, dwWizardState, diAdvancedSettings.szTitle, DlgAdvancedSettings); + hDlgCurrent = InstantiateDialog(hWndMain, dwWizardState, diAdvancedSettings.szTitle, DlgProcAdvancedSettings); else { dwWizardState = DLG_ADVANCED_SETTINGS; @@ -2304,8 +2426,9 @@ void DlgSequenceNext() break; case DLG_ADVANCED_SETTINGS: - dwWizardState = DLG_START_INSTALL; + dwWizardState = DLG_DOWNLOAD_OPTIONS; gbProcessingXpnstallFiles = FALSE; + do { hrValue = VerifyDiskSpace(); @@ -2329,6 +2452,18 @@ void DlgSequenceNext() 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) hDlgCurrent = InstantiateDialog(hWndMain, dwWizardState, diStartInstall.szTitle, DlgProcStartInstall); else @@ -2359,7 +2494,7 @@ void DlgSequenceNext() if(CheckInstances()) { /* save the installer files in the local machine */ - if(diAdvancedSettings.bSaveInstaller) + if(diDownloadOptions.bSaveInstaller) SaveInstallerFiles(); CleanupXpcomFile(); @@ -2392,7 +2527,7 @@ void DlgSequenceNext() CreateDirectoriesAll(szBuf, TRUE); /* save the installer files in the local machine */ - if(diAdvancedSettings.bSaveInstaller) + if(diDownloadOptions.bSaveInstaller) SaveInstallerFiles(); hrErr = SmartUpdateJars(); @@ -2452,12 +2587,21 @@ void DlgSequencePrev() dwWizardState = DLG_ADVANCED_SETTINGS; gbProcessingXpnstallFiles = FALSE; if(diAdvancedSettings.bShowDialog) - hDlgCurrent = InstantiateDialog(hWndMain, dwWizardState, diAdvancedSettings.szTitle, DlgAdvancedSettings); + hDlgCurrent = InstantiateDialog(hWndMain, dwWizardState, diAdvancedSettings.szTitle, DlgProcAdvancedSettings); else PostMessage(hWndMain, WM_COMMAND, IDWIZBACK, 0); break; 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; gbProcessingXpnstallFiles = FALSE; if(CheckWizardStateCustom(DLG_SELECT_COMPONENTS)) diff --git a/xpinstall/wizard/windows/setup/dialogs.h b/xpinstall/wizard/windows/setup/dialogs.h index 62bda79819e..b304e505536 100644 --- a/xpinstall/wizard/windows/setup/dialogs.h +++ b/xpinstall/wizard/windows/setup/dialogs.h @@ -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 DlgProcWindowsIntegration(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 DlgProcStartInstall(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); void AppendStringWOAmpersand(LPSTR szInputString, DWORD dwInputStringSize, LPSTR szString); void TruncateString(HWND hWnd, LPSTR szInPath, DWORD dwInPathBufSize, LPSTR szOutPath, DWORD dwOutPathBufSize); +void SaveDownloadOptions(HWND hDlg, HWND hwndCBSiteSelector); WNDPROC SubclassWindow( HWND hWnd, WNDPROC NewWndProc); LRESULT CALLBACK ListBoxBrowseWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); diff --git a/xpinstall/wizard/windows/setup/extern.h b/xpinstall/wizard/windows/setup/extern.h index 6dded7982e6..f368160d497 100644 --- a/xpinstall/wizard/windows/setup/extern.h +++ b/xpinstall/wizard/windows/setup/extern.h @@ -82,6 +82,7 @@ extern diSC diSelectComponents; extern diSC diSelectAdditionalComponents; extern diWI diWindowsIntegration; extern diPF diProgramFolder; +extern diDO diDownloadOptions; extern diAS diAdvancedSettings; extern diSI diStartInstall; extern diR diReboot; diff --git a/xpinstall/wizard/windows/setup/extra.c b/xpinstall/wizard/windows/setup/extra.c index 520d359c960..7c11d1f48a4 100644 --- a/xpinstall/wizard/windows/setup/extra.c +++ b/xpinstall/wizard/windows/setup/extra.c @@ -1739,16 +1739,37 @@ void DeInitDlgProgramFolder(diPF *diDialog) FreeMemory(&(diDialog->szMessage0)); } -HRESULT InitDlgAdvancedSettings(diAS *diDialog) +HRESULT InitDlgDownloadOptions(diDO *diDialog) { - diDialog->bShowDialog = FALSE; - diDialog->bSaveInstaller = FALSE; - if((diDialog->szTitle = NS_GlobalAlloc(MAX_BUF)) == NULL) + diDialog->bShowDialog = FALSE; + diDialog->bSaveInstaller = FALSE; + if((diDialog->szTitle = NS_GlobalAlloc(MAX_BUF)) == NULL) return(1); if((diDialog->szMessage0 = NS_GlobalAlloc(MAX_BUF)) == NULL) return(1); if((diDialog->szMessage1 = NS_GlobalAlloc(MAX_BUF)) == NULL) 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) return(1); if((diDialog->szProxyPort = NS_GlobalAlloc(MAX_BUF)) == NULL) @@ -1761,7 +1782,6 @@ void DeInitDlgAdvancedSettings(diAS *diDialog) { FreeMemory(&(diDialog->szTitle)); FreeMemory(&(diDialog->szMessage0)); - FreeMemory(&(diDialog->szMessage1)); FreeMemory(&(diDialog->szProxyServer)); FreeMemory(&(diDialog->szProxyPort)); } @@ -4026,6 +4046,8 @@ HRESULT ParseConfigIni(LPSTR lpszCmdLine) return(1); if(InitDlgProgramFolder(&diProgramFolder)) return(1); + if(InitDlgDownloadOptions(&diDownloadOptions)) + return(1); if(InitDlgAdvancedSettings(&diAdvancedSettings)) return(1); if(InitDlgStartInstall(&diStartInstall)) @@ -4253,16 +4275,24 @@ HRESULT ParseConfigIni(LPSTR lpszCmdLine) if(lstrcmpi(szShowDialog, "TRUE") == 0) 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 */ GetPrivateProfileString("Dialog Advanced Settings", "Show Dialog", "", szShowDialog, 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", "Message1", "", diAdvancedSettings.szMessage1, 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", "Save Installer", "", szBuf, MAX_BUF, szFileIniConfig); - if(lstrcmpi(szBuf, "TRUE") == 0) - diAdvancedSettings.bSaveInstaller = TRUE; if(lstrcmpi(szShowDialog, "TRUE") == 0) diAdvancedSettings.bShowDialog = TRUE; @@ -4332,6 +4362,7 @@ HRESULT ParseConfigIni(LPSTR lpszCmdLine) diSelectAdditionalComponents.bShowDialog = FALSE; diWindowsIntegration.bShowDialog = FALSE; diProgramFolder.bShowDialog = FALSE; + diDownloadOptions.bShowDialog = FALSE; diAdvancedSettings.bShowDialog = FALSE; diStartInstall.bShowDialog = FALSE; break; @@ -5436,6 +5467,7 @@ void DeInitialize() DeInitSDObject(); DeInitDlgReboot(&diReboot); DeInitDlgStartInstall(&diStartInstall); + DeInitDlgDownloadOptions(&diDownloadOptions); DeInitDlgAdvancedSettings(&diAdvancedSettings); DeInitDlgProgramFolder(&diProgramFolder); DeInitDlgWindowsIntegration(&diWindowsIntegration); @@ -5459,6 +5491,27 @@ void DeInitialize() 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() { int i; @@ -5470,14 +5523,7 @@ void SaveInstallerFiles() DWORD dwIndex0; siC *siCObject = NULL; - lstrcpy(szDestination, sgProduct.szPath); - AppendBackSlash(szDestination, sizeof(szDestination)); - if(*sgProduct.szSubPath != '\0') - { - lstrcat(szDestination, sgProduct.szSubPath); - AppendBackSlash(szDestination, sizeof(szDestination)); - } - lstrcat(szDestination, "Install"); + GetSaveInstallerPath(szDestination, sizeof(szDestination)); AppendBackSlash(szDestination, sizeof(szDestination)); /* copy all files from the ns_temp dir to the install dir */ diff --git a/xpinstall/wizard/windows/setup/extra.h b/xpinstall/wizard/windows/setup/extra.h index 27740db03e3..93025e1a22b 100644 --- a/xpinstall/wizard/windows/setup/extra.h +++ b/xpinstall/wizard/windows/setup/extra.h @@ -174,6 +174,7 @@ void SetSetupRunMode(LPSTR szMode); void Delay(DWORD dwSeconds); siCD *InitWinInitNodes(char *szInFile); void UpdateWininit(LPSTR szUninstallFilename); +char *GetSaveInstallerPath(char *szBuf, DWORD dwBufSize); void SaveInstallerFiles(void); void ResetComponentAttributes(char *szFileIni); BOOL IsInList(DWORD dwCurrentItem, DWORD dwItems, DWORD *dwItemsSelected); diff --git a/xpinstall/wizard/windows/setup/setup.c b/xpinstall/wizard/windows/setup/setup.c index dbf84ad0692..f95e6ebdbcb 100644 --- a/xpinstall/wizard/windows/setup/setup.c +++ b/xpinstall/wizard/windows/setup/setup.c @@ -82,6 +82,7 @@ diSC diSelectComponents; diSC diSelectAdditionalComponents; diWI diWindowsIntegration; diPF diProgramFolder; +diDO diDownloadOptions; diAS diAdvancedSettings; diSI diStartInstall; diR diReboot; diff --git a/xpinstall/wizard/windows/setup/setup.h b/xpinstall/wizard/windows/setup/setup.h index 53672e8f5aa..43b1de2fde0 100644 --- a/xpinstall/wizard/windows/setup/setup.h +++ b/xpinstall/wizard/windows/setup/setup.h @@ -237,15 +237,23 @@ typedef struct dlgProgramFolder LPSTR szMessage0; } diPF; -typedef struct dlgAdvancedSettings +typedef struct dlgDownloadOptions { BOOL bShowDialog; LPSTR szTitle; LPSTR szMessage0; LPSTR szMessage1; + LPSTR szMessage2; + BOOL bSaveInstaller; +} diDO; + +typedef struct dlgAdvancedSettings +{ + BOOL bShowDialog; + LPSTR szTitle; + LPSTR szMessage0; LPSTR szProxyServer; LPSTR szProxyPort; - BOOL bSaveInstaller; } diAS; typedef struct dlgStartInstall diff --git a/xpinstall/wizard/windows/setuprsc/setuprsc.h b/xpinstall/wizard/windows/setuprsc/setuprsc.h index 2ce5694039a..3693ea06f96 100644 --- a/xpinstall/wizard/windows/setuprsc/setuprsc.h +++ b/xpinstall/wizard/windows/setuprsc/setuprsc.h @@ -100,6 +100,10 @@ #define IDC_EDIT_PROXY_PORT 1063 #define IDC_TAB1 1064 #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_LICENSE 2002 #define DLG_SETUP_TYPE 2003 @@ -115,6 +119,7 @@ #define DLG_ADVANCED_SETTINGS 10207 #define DLG_SELECT_ADDITIONAL_COMPONENTS 10208 #define DLG_UPGRADE 10209 +#define DLG_DOWNLOAD_OPTIONS 10210 #define IDB_BOX_CHECKED 10304 #define IDB_BOX_UNCHECKED 10306 #define IDB_BOX_CHECKED_DISABLED 10307 @@ -130,6 +135,7 @@ #define IDWIZBACK 11013 #define IDWIZNEXT 11014 #define IDS_MSG_CREATE_DIRECTORY 11015 +#define IDWIZNEXT2 11015 #define IDS_STR_CREATE_DIRECTORY 11016 #define IDS_ERROR_PROGRAM_FOLDER_NAME 11017 #define IDS_CB_DEFAULT 11018 @@ -139,6 +145,9 @@ #define IDS_STR_DESTINATION_DIRECTORY 11022 #define IDS_STR_PROGRAM_FOLDER 11023 #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 // Next default values for new objects @@ -148,7 +157,7 @@ #define _APS_NO_MFC 1 #define _APS_NEXT_RESOURCE_VALUE 112 #define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1066 +#define _APS_NEXT_CONTROL_VALUE 1070 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/xpinstall/wizard/windows/setuprsc/setuprsc.rc b/xpinstall/wizard/windows/setuprsc/setuprsc.rc index 8f2440e6433..100eac4539e 100644 --- a/xpinstall/wizard/windows/setuprsc/setuprsc.rc +++ b/xpinstall/wizard/windows/setuprsc/setuprsc.rc @@ -185,8 +185,6 @@ FONT 8, "MS Sans Serif" BEGIN EDITTEXT IDC_CURRENT_SETTINGS,101,67,204,106,ES_MULTILINE | 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 DEFPUSHBUTTON "&Install",IDWIZNEXT,188,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 FONT 8, "MS Sans Serif" BEGIN - COMBOBOX IDC_LIST_SITE_SELECTOR,101,49,206,124,CBS_DROPDOWNLIST | - CBS_SORT | CBS_NOINTEGRALHEIGHT | WS_VSCROLL | - 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 + EDITTEXT IDC_EDIT_PROXY_SERVER,147,65,152,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_PROXY_PORT,147,82,152,12,ES_AUTOHSCROLL DEFPUSHBUTTON "&Ok",IDWIZNEXT,188,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, WS_EX_CLIENTEDGE CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1, WS_EX_STATICEDGE - LTEXT "",IDC_MESSAGE0,101,11,204,33,NOT WS_GROUP - RTEXT "Server:",IDC_STATIC,108,85,35,9 - RTEXT "Port:",IDC_STATIC,108,101,35,9 - GROUPBOX "Proxy Settings:",IDC_STATIC,101,70,206,51 + RTEXT "Server:",IDC_STATIC,108,67,35,9 + RTEXT "Port:",IDC_STATIC,108,83,35,9 + GROUPBOX "Proxy Settings:",IDC_STATIC,101,52,206,51 + LTEXT "",IDC_MESSAGE0,101,11,204,37,NOT WS_GROUP END 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 FONT 8, "MS Sans Serif" 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_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 + 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 @@ -424,6 +440,9 @@ STRINGTABLE DISCARDABLE BEGIN IDS_STR_DELETING_DESTINATION_DIR "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 #endif // English (U.S.) resources