From 1a53ce4e18862d76f816824922222aa6890a1285 Mon Sep 17 00:00:00 2001 From: "selmer%netscape.com" Date: Fri, 5 Nov 1999 19:18:33 +0000 Subject: [PATCH] Fixups --- cck/ib/comp.cpp | 25 +++++++++++++------------ cck/ib/comp.h | 11 +++++++++++ cck/ib/ib.cpp | 17 +++++++++++++---- 3 files changed, 37 insertions(+), 16 deletions(-) create mode 100644 cck/ib/comp.h diff --git a/cck/ib/comp.cpp b/cck/ib/comp.cpp index 77d35f7da4c5..8be19bd5d4e3 100644 --- a/cck/ib/comp.cpp +++ b/cck/ib/comp.cpp @@ -15,7 +15,7 @@ extern CString iniPath; extern CString scriptPath; extern CString nscpxpiPath; -extern COMPONENT SelectedComponents[100]; +extern COMPONENT Components[100]; extern int numComponents; extern "C" __declspec(dllexport) @@ -40,6 +40,7 @@ int BuildComponentList(COMPONENT *comps, int *compNum) GetPrivateProfileString(component, "Attributes", "", attr, MAX_SIZE, iniPath); + comps[*compNum].archive = CString(archive); comps[*compNum].compname = component; comps[*compNum].name = CString(name); comps[*compNum].desc = CString(desc); @@ -70,30 +71,30 @@ int GenerateComponentList(CString parms, WIDGET *curWidget) nscpxpiPath = rootPath + "NSCPXPI"; iniPath = nscpxpiPath + "\\config.ini"; - BuildComponentList(SelectedComponents, &numComponents); + BuildComponentList(Components, &numComponents); int i; CString WidgetValue(""); for (i=0; ioptions.name[i] = new char[strlen(SelectedComponents[i].compname)+1]; - strcpy(curWidget->options.name[i], SelectedComponents[i].compname); + curWidget->options.name[i] = new char[strlen(Components[i].compname)+1]; + strcpy(curWidget->options.name[i], Components[i].compname); - curWidget->options.value[i] = new char[strlen(SelectedComponents[i].name)+1]; - strcpy(curWidget->options.value[i], SelectedComponents[i].name); + curWidget->options.value[i] = new char[strlen(Components[i].name)+1]; + strcpy(curWidget->options.value[i], Components[i].name); - curWidget->optDesc.name[i] = new char[strlen(SelectedComponents[i].compname)+1]; - strcpy(curWidget->optDesc.name[i], SelectedComponents[i].compname); + curWidget->optDesc.name[i] = new char[strlen(Components[i].compname)+1]; + strcpy(curWidget->optDesc.name[i], Components[i].compname); - curWidget->optDesc.value[i] = new char[strlen(SelectedComponents[i].desc)+1]; - strcpy(curWidget->optDesc.value[i], SelectedComponents[i].desc); + curWidget->optDesc.value[i] = new char[strlen(Components[i].desc)+1]; + strcpy(curWidget->optDesc.value[i], Components[i].desc); // INVISIBLE just means not selected, let user decide whether to // include them again. SELECTED components get checkmarks. - if (SelectedComponents[i].selected) + if (Components[i].selected) { WidgetValue += ","; - WidgetValue += SelectedComponents[i].name; + WidgetValue += Components[i].name; } } diff --git a/cck/ib/comp.h b/cck/ib/comp.h new file mode 100644 index 000000000000..91d3c5a8ab43 --- /dev/null +++ b/cck/ib/comp.h @@ -0,0 +1,11 @@ +typedef struct s_component { + CString archive; + CString compname; + CString name; + CString desc; + BOOL selected; + BOOL invisible; + BOOL launchapp; + } COMPONENT; + +extern "C" __declspec(dllexport) int BuildComponentList(COMPONENT *comps, int *compNum); diff --git a/cck/ib/ib.cpp b/cck/ib/ib.cpp index 58e4dee0dc32..d48645baab42 100644 --- a/cck/ib/ib.cpp +++ b/cck/ib/ib.cpp @@ -23,7 +23,7 @@ char buffer[50000]; XPI xpiList[100]; int xpiLen = -1; -COMPONENT SelectedComponents[100]; +COMPONENT Components[100]; int numComponents; int findXPI(CString xpiname, CString filename) @@ -260,12 +260,12 @@ void init_components() { int i; WIDGET *w = findWidget("SelectedComponents"); - BuildComponentList(SelectedComponents, &numComponents); + BuildComponentList(Components, &numComponents); // Turn off components that aren't selected for (i=0; ivalue) == NULL) - SelectedComponents[i].selected = FALSE; + if (strstr(Components[i].name, w->value) == NULL) + Components[i].selected = FALSE; } @@ -338,7 +338,16 @@ int StartIB(CString parms, WIDGET *curWidget) // Copy remaining default installer files into config // preserving any existing files that we created already // in previous steps + /* -- Need to be more selective than this CopyDir(nscpxpiPath, cdPath, NULL, FALSE); + */ + for (int i=0; i