mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-05 16:22:53 +00:00
Fixups
This commit is contained in:
parent
69f6a5d415
commit
1a53ce4e18
@ -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; i<numComponents; i++)
|
||||
{
|
||||
curWidget->options.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;
|
||||
}
|
||||
}
|
||||
|
||||
|
11
cck/ib/comp.h
Normal file
11
cck/ib/comp.h
Normal file
@ -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);
|
@ -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; i<numComponents; i++)
|
||||
if (strstr(SelectedComponents[i].name, w->value) == 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<numComponents; i++)
|
||||
{
|
||||
if (Components[i].selected)
|
||||
CopyFile(nscpxpiPath + Components[i].archive,
|
||||
cdPath + Components[i].archive, FALSE);
|
||||
}
|
||||
// Didn't work...
|
||||
|
||||
ReplaceINIFile();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user