75230: CCK should be updated to a new release (r=tao)

Parsing the new format of the Comfig.ini file.
This commit is contained in:
shrutiv%netscape.com 2001-05-03 23:29:43 +00:00
parent 6048f77b96
commit 111027b902
3 changed files with 63 additions and 34 deletions

View File

@ -17,21 +17,49 @@ extern CString scriptPath;
extern CString nscpxpiPath;
extern COMPONENT Components[100];
extern int numComponents;
extern int numComponents;
extern CString compString;
extern "C" __declspec(dllexport)
int BuildComponentList(COMPONENT *comps, int *compNum, CString iniSrcPath,int invisibleCount)
int BuildComponentList(COMPONENT *comps, CString compString, int& compNum, CString iniSrcPath,int invisibleCount)
{
*compNum = 0;
int invNum = *compNum;
CString configcompString[50];
compNum=0;
configcompString[0]="XPCOM";
configcompString[1]="Navigator";
configcompString[2]="Java";
configcompString[3]="MailNews";
configcompString[4]="Instant Messenger";
configcompString[5]="QFA";
configcompString[6]="PSM";
configcompString[7]="Spell Checker";
configcompString[8]="AOL Art";
configcompString[9]="Net2Phone";
configcompString[10]="Flash";
configcompString[11]="Uninstaller";
configcompString[12]="AOD";
configcompString[13]="RealPlayer";
configcompString[14]="US English Profile Defaults";
configcompString[15]="HP Printer Plugin";
configcompString[16]="Classic Skin";
configcompString[17]="En US lang pack";
configcompString[18]="US region pack";
configcompString[19]=" ";
int arrayindex=compNum;
compString = configcompString[compNum];
CString invNum = compString;
// Get all the component info from each component section
CString component;
char archive[MAX_SIZE];
char name[MAX_SIZE];
char desc[MAX_SIZE];
char attr[MAX_SIZE];
component.Format("Component%d", *compNum);
component.Format("Component %s", compString);
GetPrivateProfileString(component, "Archive", "", archive, MAX_SIZE, iniSrcPath);
while (*archive)
{
@ -42,31 +70,32 @@ int BuildComponentList(COMPONENT *comps, int *compNum, CString iniSrcPath,int in
GetPrivateProfileString(component, "Attributes", "",
attr, MAX_SIZE, iniSrcPath);
comps[*compNum].archive = CString(archive);
comps[*compNum].compname = component;
comps[*compNum].name = CString(name);
comps[*compNum].desc = CString(desc);
comps[*compNum].selected = (strstr(attr, "SELECTED") != NULL);
comps[*compNum].invisible = (strstr(attr, "INVISIBLE") != NULL);
comps[*compNum].launchapp = (strstr(attr, "LAUNCHAPP") != NULL);
comps[*compNum].additional = (strstr(attr, "ADDITIONAL") != NULL);
if (!(comps[*compNum].selected && comps[*compNum].invisible && invisibleCount))
{
(*compNum)++;
invNum++;
component.Format("Component%d", invNum);
}
else
{
invNum++;
component.Format("Component%d", invNum);
comps[compNum].archive = CString(archive);
comps[compNum].compname = component;
comps[compNum].name = CString(name);
comps[compNum].desc = CString(desc);
comps[compNum].selected = (strstr(attr, "SELECTED") != NULL);
comps[compNum].invisible = (strstr(attr, "INVISIBLE") != NULL);
comps[compNum].launchapp = (strstr(attr, "LAUNCHAPP") != NULL);
comps[compNum].additional = (strstr(attr, "ADDITIONAL") != NULL);
if (!(comps[compNum].selected && comps[compNum].invisible && invisibleCount))
{
compNum++;
compString = configcompString[compNum];
arrayindex++;
invNum = configcompString[arrayindex];
component.Format("Component %s", invNum);
}
else
{
arrayindex++;
invNum=configcompString[arrayindex];
component.Format("Component %s", invNum);
}
GetPrivateProfileString(component, "Archive", "", archive, MAX_SIZE, iniSrcPath);
}
return TRUE;
}
@ -84,8 +113,8 @@ int GenerateComponentList(CString parms, WIDGET *curWidget)
nscpxpiPath = rootPath + "NSCPXPI";
iniSrcPath = nscpxpiPath + "\\config.ini";
BuildComponentList(Components, &numComponents, iniSrcPath, 1);
BuildComponentList(Components, compString, numComponents, iniSrcPath, 1);
int i;
CString WidgetValue("");
for (i=0; i<numComponents; i++)

View File

@ -10,4 +10,4 @@ typedef struct s_component {
} COMPONENT;
extern "C" __declspec(dllexport)
int BuildComponentList(COMPONENT *comps, int *compNum, CString iniSrcPath,int invisibleCount);
int BuildComponentList(COMPONENT *comps, CString compString, int& compNum, CString iniSrcPath,int invisibleCount);

View File

@ -43,6 +43,7 @@ BOOL prefDoesntExist = TRUE;
COMPONENT Components[100];
int numComponents;
int componentOrder;
CString compString=" ";
int findXPI(CString xpiname, CString filename)
{
@ -541,8 +542,7 @@ void init_components()
{
int i;
WIDGET *w = findWidget("SelectedComponents");
BuildComponentList(Components, &numComponents, iniSrcPath,0);
BuildComponentList(Components, compString, numComponents, iniSrcPath,0);
// Turn off components that aren't selected
for (i=0; i<numComponents; i++)
{
@ -669,7 +669,7 @@ void AddThirdParty()
if ((firstSix.CompareNoCase("Please") != 0) && !(tpCompPath1.IsEmpty()))
{
componentName.Format("Component%d", (numComponents));
componentName.Format("Component %s", (compString));
cName.Format("C%d", componentOrder);
componentOrder++;
@ -685,7 +685,7 @@ void AddThirdParty()
firstSix = tpCompPath2.Left(6);
if ((firstSix.CompareNoCase("Please") != 0) && !(tpCompPath2.IsEmpty()))
{
componentName.Format("Component%d", (numComponents));
componentName.Format("Component %s", (compString));
cName.Format("C%d", componentOrder);
WritePrivateProfileString("Setup Type0", cName, componentName, iniDstPath);