fixing bug #38568. affects only windows platforms.

This commit is contained in:
ssu%netscape.com 2000-05-10 22:06:36 +00:00
Родитель 4d19e3fe58
Коммит 56c2644cd0
5 изменённых файлов: 81 добавлений и 61 удалений

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

@ -729,27 +729,47 @@ LRESULT CALLBACK DlgProcSetupType(HWND hDlg, UINT msg, WPARAM wParam, LONG lPara
/* retrieve and save the state of the selected radio button */
if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST0) == BST_CHECKED)
{
if(dwSetupType != ST_RADIO0)
{
ResetComponentAttributes(szFileIniConfig);
SiCNodeSetItemsSelected(diSetupType.stSetupType0.dwCItems, diSetupType.stSetupType0.dwCItemsSelected);
}
dwSetupType = ST_RADIO0;
dwTempSetupType = dwSetupType;
SiCNodeSetItemsSelected(diSetupType.stSetupType0.dwCItems, diSetupType.stSetupType0.dwCItemsSelected);
}
else if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST1) == BST_CHECKED)
{
if(dwSetupType != ST_RADIO1)
{
ResetComponentAttributes(szFileIniConfig);
SiCNodeSetItemsSelected(diSetupType.stSetupType1.dwCItems, diSetupType.stSetupType1.dwCItemsSelected);
}
dwSetupType = ST_RADIO1;
dwTempSetupType = dwSetupType;
SiCNodeSetItemsSelected(diSetupType.stSetupType1.dwCItems, diSetupType.stSetupType1.dwCItemsSelected);
}
else if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST2) == BST_CHECKED)
{
if(dwSetupType != ST_RADIO2)
{
ResetComponentAttributes(szFileIniConfig);
SiCNodeSetItemsSelected(diSetupType.stSetupType2.dwCItems, diSetupType.stSetupType2.dwCItemsSelected);
}
dwSetupType = ST_RADIO2;
dwTempSetupType = dwSetupType;
SiCNodeSetItemsSelected(diSetupType.stSetupType2.dwCItems, diSetupType.stSetupType2.dwCItemsSelected);
}
else if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST3) == BST_CHECKED)
{
if(dwSetupType != ST_RADIO3)
{
ResetComponentAttributes(szFileIniConfig);
SiCNodeSetItemsSelected(diSetupType.stSetupType3.dwCItems, diSetupType.stSetupType3.dwCItemsSelected);
}
dwSetupType = ST_RADIO3;
dwTempSetupType = dwSetupType;
SiCNodeSetItemsSelected(diSetupType.stSetupType3.dwCItems, diSetupType.stSetupType3.dwCItemsSelected);
}
/* set the next dialog to be shown depending on the

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

@ -1769,8 +1769,9 @@ HRESULT InitSetupGeneral()
{
char szBuf[MAX_BUF];
sgProduct.dwMode = NORMAL;
sgProduct.dwCustomType = ST_RADIO0;
sgProduct.dwMode = NORMAL;
sgProduct.dwCustomType = ST_RADIO0;
sgProduct.dwNumberOfComponents = 0;
if((sgProduct.szPath = NS_GlobalAlloc(MAX_BUF)) == NULL)
return(1);
@ -2140,61 +2141,35 @@ void SiCNodeSetAttributes(DWORD dwIndex, DWORD dwAttributes, BOOL bSet, BOOL bIn
}
}
BOOL IsInList(DWORD dwCurrentItem, DWORD dwItems, DWORD *dwItemsSelected)
{
DWORD i;
for(i = 0; i < dwItems; i++)
{
if(dwItemsSelected[i] == dwCurrentItem)
return(TRUE);
}
return(FALSE);
}
void SiCNodeSetItemsSelected(DWORD dwItems, DWORD *dwItemsSelected)
{
DWORD i;
DWORD dwCount;
siC *siCTemp;
dwCount = 0;
siCTemp = siComponents;
if(siCTemp != NULL)
for(i = 0; i < sgProduct.dwNumberOfComponents; i++)
{
for(i = 0; i < dwItems; i++)
siCTemp = SiCNodeGetObject(i, TRUE, AC_ALL);
if(IsInList(i, dwItems, dwItemsSelected))
{
if(dwItemsSelected[i] == dwCount)
{
/* Found the item that was selected, set the */
/* SIC_SELECTED attribute and break*/
if((siCTemp->lRandomInstallPercentage == 0) ||
(siCTemp->lRandomInstallPercentage > siCTemp->lRandomInstallValue))
siCTemp->dwAttributes |= SIC_SELECTED;
else
siCTemp->dwAttributes &= ~SIC_SELECTED;
break;
}
else
/* unset the SIC_SELECTED attribute and */
/* keep looking for the selected item (if any) */
if((siCTemp->lRandomInstallPercentage != 0) &&
(siCTemp->lRandomInstallPercentage <= siCTemp->lRandomInstallValue))
siCTemp->dwAttributes &= ~SIC_SELECTED;
}
++dwCount;
siCTemp = siCTemp->Next;
while((siCTemp != NULL) && (siCTemp != siComponents))
{
for(i = 0; i < dwItems; i++)
{
if(dwItemsSelected[i] == dwCount)
{
/* Found the item that was selected, set the */
/* SIC_SELECTED attribute and break*/
if((siCTemp->lRandomInstallPercentage == 0) ||
(siCTemp->lRandomInstallPercentage > siCTemp->lRandomInstallValue))
siCTemp->dwAttributes |= SIC_SELECTED;
else
siCTemp->dwAttributes &= ~SIC_SELECTED;
break;
}
else
/* unset the SIC_SELECTED attribute and */
/* keep looking for the selected item (if any) */
siCTemp->dwAttributes &= ~SIC_SELECTED;
}
++dwCount;
siCTemp = siCTemp->Next;
}
else
siCTemp->dwAttributes &= ~SIC_SELECTED;
}
}
@ -3152,6 +3127,28 @@ void InitSiComponents(char *szFileIni)
lstrcat(szComponentItem, szIndex0);
GetPrivateProfileString(szComponentItem, "Archive", "", szBuf, MAX_BUF, szFileIni);
}
sgProduct.dwNumberOfComponents = dwIndex0;
}
void ResetComponentAttributes(char *szFileIni)
{
char szIndex[MAX_BUF];
char szBuf[MAX_BUF];
char szComponentItem[MAX_BUF];
siC *siCTemp;
DWORD dwCounter;
for(dwCounter = 0; dwCounter < sgProduct.dwNumberOfComponents; dwCounter++)
{
itoa(dwCounter, szIndex, 10);
lstrcpy(szComponentItem, "Component");
lstrcat(szComponentItem, szIndex);
siCTemp = SiCNodeGetObject(dwCounter, TRUE, AC_ALL);
GetPrivateProfileString(szComponentItem, "Attributes", "", szBuf, MAX_BUF, szFileIni);
siCTemp->dwAttributes = ParseComponentAttributes(szBuf);
}
}
void UpdateSiteSelector()

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

@ -175,6 +175,8 @@ void Delay(DWORD dwSeconds);
siCD *InitWinInitNodes(char *szInFile);
void UpdateWininit(LPSTR szUninstallFilename);
void SaveInstallerFiles(void);
void ResetComponentAttributes(char *szFileIni);
BOOL IsInList(DWORD dwCurrentItem, DWORD dwItems, DWORD *dwItemsSelected);
BOOL bSDInit;

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

@ -256,6 +256,7 @@ typedef struct setupStruct
{
DWORD dwMode;
DWORD dwCustomType;
DWORD dwNumberOfComponents;
LPSTR szPath;
LPSTR szProductName;
LPSTR szProgramFolderName;

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

@ -54,7 +54,7 @@ END
DLG_WELCOME DIALOGEX 51, 56, 315, 205
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
DEFPUSHBUTTON "&Next >",IDWIZNEXT,188,186,53,14
PUSHBUTTON "&Cancel",IDCANCEL,252,186,53,14
@ -69,7 +69,7 @@ END
DLG_SETUP_TYPE DIALOGEX 51, 56, 315, 205
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
CONTROL "",IDC_RADIO_ST0,"Button",BS_AUTORADIOBUTTON |
WS_TABSTOP,102,31,65,8
@ -109,7 +109,7 @@ BEGIN
LTEXT "",IDC_MESSAGE0,101,10,204,19,NOT WS_GROUP
LTEXT "C&omponents:",IDC_STATIC,101,32,103,8
GROUPBOX "Description",IDC_STATIC,101,115,204,22
LTEXT "",IDC_STATIC_DESCRIPTION,106,124,195,8
LTEXT "",IDC_STATIC_DESCRIPTION,106,124,195,8,SS_NOPREFIX
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
@ -124,7 +124,7 @@ END
DLG_WINDOWS_INTEGRATION DIALOGEX 51, 56, 315, 205
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
CONTROL "Check0",IDC_CHECK0,"Button",BS_AUTOCHECKBOX | BS_TOP |
BS_MULTILINE | WS_TABSTOP,101,32,205,17
@ -147,7 +147,7 @@ END
DLG_PROGRAM_FOLDER DIALOGEX 51, 56, 315, 205
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
EDITTEXT IDC_EDIT_PROGRAM_FOLDER,101,64,204,12,ES_AUTOHSCROLL
LISTBOX IDC_LIST,101,94,204,79,LBS_SORT | LBS_NOINTEGRALHEIGHT |
@ -166,7 +166,7 @@ END
DLG_LICENSE DIALOGEX 51, 56, 315, 205
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
DEFPUSHBUTTON "&Accept",IDWIZNEXT,188,186,53,14
PUSHBUTTON "&No",IDCANCEL,252,186,53,14
@ -181,7 +181,7 @@ END
DLG_START_INSTALL DIALOGEX 51, 56, 315, 205
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
EDITTEXT IDC_CURRENT_SETTINGS,101,67,204,106,ES_MULTILINE |
ES_OEMCONVERT | ES_READONLY | WS_VSCROLL | WS_HSCROLL
@ -252,7 +252,7 @@ END
DLG_ADVANCED_SETTINGS DIALOGEX 51, 56, 315, 205
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
COMBOBOX IDC_LIST_SITE_SELECTOR,101,49,206,124,CBS_DROPDOWNLIST |
CBS_SORT | CBS_NOINTEGRALHEIGHT | WS_VSCROLL |
@ -285,7 +285,7 @@ BEGIN
LTEXT "",IDC_MESSAGE0,101,10,204,19,NOT WS_GROUP
LTEXT "&Additional Components:",IDC_STATIC,101,32,125,8
GROUPBOX "Description",IDC_STATIC,101,115,204,22
LTEXT "",IDC_STATIC_DESCRIPTION,106,124,195,8
LTEXT "",IDC_STATIC_DESCRIPTION,106,124,195,8,SS_NOPREFIX
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