Fix for bug 155468: Installation of c11n build crash due to incorrect

attributes for Viewpoint (r=smeredith)
This commit is contained in:
shrutiv%netscape.com 2002-07-12 23:48:13 +00:00
Родитель b4a19174ec
Коммит 7d7d85c725
3 изменённых файлов: 72 добавлений и 41 удалений

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

@ -131,7 +131,12 @@ int BuildComponentList(COMPONENT *comps, int *compNum, CString iniSrcPath,
comps[*compNum].forceupgrade = (strstr(attr, "FORCE_UPGRADE") != NULL); comps[*compNum].forceupgrade = (strstr(attr, "FORCE_UPGRADE") != NULL);
comps[*compNum].uncompress = (strstr(attr, "UNCOMPRESS") != NULL); comps[*compNum].uncompress = (strstr(attr, "UNCOMPRESS") != NULL);
comps[*compNum].downloadonly = (strstr(attr, "DOWNLOAD_ONLY") != NULL); comps[*compNum].downloadonly = (strstr(attr, "DOWNLOAD_ONLY") != NULL);
comps[*compNum].supersede = (strstr(attr, "SUPERSEDE") != NULL);
comps[*compNum].ignoreerror = (strstr(attr, "IGNORE_DOWNLOAD_ERROR") != NULL);
comps[*compNum].unselected = (strstr(attr, "UNSELECTED") != NULL); comps[*compNum].unselected = (strstr(attr, "UNSELECTED") != NULL);
// using strcmp for VISIBLE attrib instead of strstr since ststr returns
// true for INVISIBLE attribs also (VISIBLE is a part of INVISIBLE)
comps[*compNum].visible = (strcmp(attr, "VISIBLE") == 0);
comps[*compNum].empty = strcmp(attr, ""); comps[*compNum].empty = strcmp(attr, "");
if (!(comps[*compNum].selected && comps[*compNum].invisible && if (!(comps[*compNum].selected && comps[*compNum].invisible &&

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

@ -12,6 +12,9 @@ typedef struct s_component {
BOOL uncompress; BOOL uncompress;
BOOL downloadonly; BOOL downloadonly;
BOOL unselected; BOOL unselected;
BOOL supersede;
BOOL ignoreerror;
BOOL visible;
BOOL empty; BOOL empty;
} COMPONENT; } COMPONENT;

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

@ -1750,7 +1750,7 @@ void init_components()
Components[i].selected = FALSE; Components[i].selected = FALSE;
} }
else else
if ((Components[i].additional) || !(Components[i].empty)) if ((Components[i].additional) || (Components[i].visible))
Components[i].selected = TRUE; Components[i].selected = TRUE;
} }
} }
@ -1788,36 +1788,54 @@ void invisible()
Cee.Format("C%d", componentOrder); Cee.Format("C%d", componentOrder);
WritePrivateProfileString("Setup Type0",(LPCTSTR)Cee,(LPCTSTR)component, iniDstPath); WritePrivateProfileString("Setup Type0",(LPCTSTR)Cee,(LPCTSTR)component, iniDstPath);
WritePrivateProfileString("Setup Type1",(LPCTSTR)Cee,(LPCTSTR)component, iniDstPath); WritePrivateProfileString("Setup Type1",(LPCTSTR)Cee,(LPCTSTR)component, iniDstPath);
if (Components[i].additional && !(Components[i].launchapp) &&
!Components[i].forceupgrade && !(Components[i].invisible)) CString strAttributes = "SELECTED";
WritePrivateProfileString(Components[i].compname, "Attributes", CString strSep = "|";
"SELECTED|ADDITIONAL", iniDstPath);
else if (Components[i].additional && !(Components[i].launchapp) && if (Components[i].disabled)
Components[i].forceupgrade && !(Components[i].unselected) && strAttributes += strSep + "DISABLED";
!(Components[i].invisible))
WritePrivateProfileString(Components[i].compname, "Attributes", if (Components[i].invisible)
"SELECTED|ADDITIONAL|FORCE_UPGRADE", iniDstPath); strAttributes += strSep + "INVISIBLE";
else if (Components[i].additional && !(Components[i].launchapp) &&
Components[i].forceupgrade && Components[i].unselected && if (Components[i].visible)
!(Components[i].invisible)) strAttributes += strSep + "VISIBLE";
WritePrivateProfileString(Components[i].compname, "Attributes",
"UNSELECTED|ADDITIONAL|FORCE_UPGRADE", iniDstPath); if (Components[i].uncompress)
else if (!(Components[i].disabled) && !(Components[i].additional) && strAttributes += strSep + "UNCOMPRESS";
Components[i].forceupgrade && !(Components[i].invisible))
WritePrivateProfileString(Components[i].compname, "Attributes", if (Components[i].launchapp)
"SELECTED|FORCE_UPGRADE", iniDstPath); strAttributes += strSep + "LAUNCHAPP";
else if (Components[i].additional && Components[i].launchapp &&
Components[i].uncompress && !(Components[i].invisible)) if (Components[i].additional)
WritePrivateProfileString(Components[i].compname, "Attributes", strAttributes += strSep + "ADDITIONAL";
"SELECTED|UNCOMPRESS|LAUNCHAPP|ADDITIONAL", iniDstPath);
else if (!(Components[i].additional) && if (Components[i].forceupgrade)
!(Components[i].forceupgrade) && !(Components[i].invisible)) strAttributes += strSep + "FORCE_UPGRADE";
WritePrivateProfileString(Components[i].compname, "Attributes",
"SELECTED|INVISIBLE", iniDstPath); if (Components[i].supersede)
componentOrder++; strAttributes += strSep + "SUPERSEDE";
if (Components[i].downloadonly)
strAttributes += strSep + "DOWNLOAD_ONLY";
if (Components[i].ignoreerror)
strAttributes += strSep + "IGNORE_DOWNLOAD_ERROR";
if (Components[i].unselected)
{
// UNSELECTED attribute must not appear with SELECTED attribute
if ( (strAttributes.Find("SELECTED")) != -1 )
strAttributes.Replace("SELECTED", "UNSELECTED");
}
WritePrivateProfileString(Components[i].compname, "Attributes",
strAttributes, iniDstPath);
componentOrder++;
} }
else else
WritePrivateProfileString(Components[i].compname, "Attributes", "INVISIBLE", iniDstPath); WritePrivateProfileString(Components[i].compname, "Attributes",
"INVISIBLE", iniDstPath);
} }
} }
@ -1855,18 +1873,23 @@ void LinuxInvisible()
WritePrivateProfileString("Setup Type1",(LPCTSTR)Cee, WritePrivateProfileString("Setup Type1",(LPCTSTR)Cee,
(LPCTSTR)component,iniDstPath); (LPCTSTR)component,iniDstPath);
if ((Components[i].invisible) && (Components[i].downloadonly)) CString strAttributes = "SELECTED";
WritePrivateProfileString(Components[i].compname,"Attributes", CString strSep = "|";
"SELECTED|INVISIBLE|DOWNLOAD_ONLY",iniDstPath);
else if ((Components[i].invisible) && !(Components[i].downloadonly)) if (Components[i].invisible)
WritePrivateProfileString(Components[i].compname,"Attributes", strAttributes += strSep + "INVISIBLE";
"SELECTED|INVISIBLE",iniDstPath);
else if (!Components[i].empty) if (Components[i].downloadonly)
WritePrivateProfileString(Components[i].compname,"Attributes", strAttributes += strSep + "DOWNLOAD_ONLY";
"",iniDstPath);
else if (Components[i].visible)
WritePrivateProfileString(Components[i].compname,"Attributes", // VISIBLE attribute must appear by itself
"SELECTED",iniDstPath); // this may require change in future if VISIBLE attribute in the
// browser installer appears with other attributes
strAttributes = "VISIBLE";
WritePrivateProfileString(Components[i].compname, "Attributes",
strAttributes, iniDstPath);
componentOrder++; componentOrder++;
} }
else else