diff --git a/cck/ib/comp.cpp b/cck/ib/comp.cpp index 8be19bd5d4e3..b83aa1635937 100644 --- a/cck/ib/comp.cpp +++ b/cck/ib/comp.cpp @@ -11,7 +11,8 @@ extern CString configPath; extern CString workspacePath; extern CString cdPath; extern CString tempPath; -extern CString iniPath; +extern CString iniSrcPath; +extern CString iniDstPath; extern CString scriptPath; extern CString nscpxpiPath; @@ -19,7 +20,7 @@ extern COMPONENT Components[100]; extern int numComponents; extern "C" __declspec(dllexport) -int BuildComponentList(COMPONENT *comps, int *compNum) +int BuildComponentList(COMPONENT *comps, int *compNum, CString iniSrcPath) { *compNum = 0; @@ -30,15 +31,15 @@ int BuildComponentList(COMPONENT *comps, int *compNum) char desc[MAX_SIZE]; char attr[MAX_SIZE]; component.Format("Component%d", *compNum); - GetPrivateProfileString(component, "Archive", "", archive, MAX_SIZE, iniPath); + GetPrivateProfileString(component, "Archive", "", archive, MAX_SIZE, iniSrcPath); while (*archive) { GetPrivateProfileString(component, "Description Short", "", - name, MAX_SIZE, iniPath); + name, MAX_SIZE, iniSrcPath); GetPrivateProfileString(component, "Description Long", "", - desc, MAX_SIZE, iniPath); + desc, MAX_SIZE, iniSrcPath); GetPrivateProfileString(component, "Attributes", "", - attr, MAX_SIZE, iniPath); + attr, MAX_SIZE, iniSrcPath); comps[*compNum].archive = CString(archive); comps[*compNum].compname = component; @@ -50,7 +51,7 @@ int BuildComponentList(COMPONENT *comps, int *compNum) (*compNum)++; component.Format("Component%d", *compNum); - GetPrivateProfileString(component, "Archive", "", archive, MAX_SIZE, iniPath); + GetPrivateProfileString(component, "Archive", "", archive, MAX_SIZE, iniSrcPath); } @@ -69,9 +70,9 @@ int GenerateComponentList(CString parms, WIDGET *curWidget) nscpxpiPath = workspacePath + "\\NSCPXPI"; else nscpxpiPath = rootPath + "NSCPXPI"; - iniPath = nscpxpiPath + "\\config.ini"; + iniSrcPath = nscpxpiPath + "\\config.ini"; - BuildComponentList(Components, &numComponents); + BuildComponentList(Components, &numComponents, iniSrcPath); int i; CString WidgetValue(""); diff --git a/cck/ib/comp.h b/cck/ib/comp.h index 91d3c5a8ab43..4c24fd3a1950 100644 --- a/cck/ib/comp.h +++ b/cck/ib/comp.h @@ -8,4 +8,5 @@ typedef struct s_component { BOOL launchapp; } COMPONENT; -extern "C" __declspec(dllexport) int BuildComponentList(COMPONENT *comps, int *compNum); +extern "C" __declspec(dllexport) +int BuildComponentList(COMPONENT *comps, int *compNum, CString iniSrcPath); diff --git a/cck/ib/ib.cpp b/cck/ib/ib.cpp index d48645baab42..1179fe1804eb 100644 --- a/cck/ib/ib.cpp +++ b/cck/ib/ib.cpp @@ -15,7 +15,8 @@ CString configPath; CString workspacePath; CString cdPath; CString tempPath; -CString iniPath; +CString iniDstPath; +CString iniSrcPath; CString scriptPath; CString nscpxpiPath; @@ -191,8 +192,7 @@ int interpret(char *cmd) } if (!section || !key || !newvalue) return FALSE; - CString iniSrc = nscpxpiPath + "\\config.ini"; - if (!CopyFile(iniSrc, iniPath, TRUE)) + if (!CopyFile(iniSrcPath, iniDstPath, TRUE)) DWORD e = GetLastError(); if (strcmp(key, "Program Folder Name") == 0) { @@ -200,7 +200,7 @@ int interpret(char *cmd) strcat(temp, newvalue); newvalue = temp; } - WritePrivateProfileString(section, key, newvalue, iniPath); + WritePrivateProfileString(section, key, newvalue, iniDstPath); } else if (strcmp(cmdname, "replaceXPI") == 0) { @@ -260,11 +260,11 @@ void init_components() { int i; WIDGET *w = findWidget("SelectedComponents"); - BuildComponentList(Components, &numComponents); + BuildComponentList(Components, &numComponents, iniSrcPath); // Turn off components that aren't selected for (i=0; ivalue) == NULL) + if (strstr(w->value, Components[i].name) == NULL) Components[i].selected = FALSE; } @@ -281,13 +281,14 @@ int StartIB(CString parms, WIDGET *curWidget) configPath = rootPath + "Configs\\" + configName; cdPath = configPath + "\\CD"; tempPath = configPath + "\\Temp"; - iniPath = cdPath + "\\config.ini"; + iniDstPath = cdPath + "\\config.ini"; scriptPath = rootPath + "\\script.ib"; workspacePath = configPath + "\\Workspace"; if (SearchPath(workspacePath, "NSCPXPI", NULL, 0, NULL, NULL)) nscpxpiPath = workspacePath + "\\NSCPXPI"; else nscpxpiPath = rootPath + "NSCPXPI"; + iniSrcPath = nscpxpiPath + "\\config.ini"; init_components(); @@ -344,8 +345,8 @@ int StartIB(CString parms, WIDGET *curWidget) for (int i=0; i