sgProduct.dwNumberOfComponents = dwIndex0;
void InitSiComponents(char *szFileIni){  DWORD dwIndex0;  DWORD dwIndex1;  char  szIndex0[MAX_BUF];  char  szIndex1[MAX_BUF];  char  szBuf[MAX_BUF];  char  szComponentItem[MAX_BUF];  char  szDependency[MAX_BUF];  char  szDependee[MAX_BUF];  char  szDPSection[MAX_BUF];  siC   *siCTemp;  siCD  *siCDepTemp;  siCD  *siCDDependeeTemp;  dwIndex0 = 0;  itoa(dwIndex0, szIndex0, 10);  lstrcpy(szComponentItem, "Component");  lstrcat(szComponentItem, szIndex0);  GetPrivateProfileString(szComponentItem, "Archive", "", szBuf, MAX_BUF, szFileIni);  while(*szBuf != '\0')  {    /* create and initialize empty node */    siCTemp = CreateSiCNode();    /* store name of archive for component */    lstrcpy(siCTemp->szArchiveName, szBuf);        /* get short description of component */    GetPrivateProfileString(szComponentItem, "Description Short", "", szBuf, MAX_BUF, szFileIni);    lstrcpy(siCTemp->szDescriptionShort, szBuf);    /* get long description of component */    GetPrivateProfileString(szComponentItem, "Description Long", "", szBuf, MAX_BUF, szFileIni);    lstrcpy(siCTemp->szDescriptionLong, szBuf);    /* get commandline parameter for component */    GetPrivateProfileString(szComponentItem, "Parameter", "", szBuf, MAX_BUF, szFileIni);    DecryptString(siCTemp->szParameter, szBuf);    /* get install size required in destination for component.  Sould be in Kilobytes */    GetPrivateProfileString(szComponentItem, "Install Size", "", szBuf, MAX_BUF, szFileIni);    if(*szBuf != '\0')      siCTemp->ullInstallSize = _atoi64(szBuf);    else      siCTemp->ullInstallSize = 0;    /* get install size required in system for component.  Sould be in Kilobytes */    GetPrivateProfileString(szComponentItem, "Install Size System", "", szBuf, MAX_BUF, szFileIni);    if(*szBuf != '\0')      siCTemp->ullInstallSizeSystem = _atoi64(szBuf);    else      siCTemp->ullInstallSizeSystem = 0;    /* get install size required in temp for component.  Sould be in Kilobytes */    GetPrivateProfileString(szComponentItem, "Install Size Archive", "", szBuf, MAX_BUF, szFileIni);    if(*szBuf != '\0')      siCTemp->ullInstallSizeArchive = _atoi64(szBuf);    else      siCTemp->ullInstallSizeArchive = 0;    /* get attributes of component */    GetPrivateProfileString(szComponentItem, "Attributes", "", szBuf, MAX_BUF, szFileIni);    siCTemp->dwAttributes = ParseComponentAttributes(szBuf);    /* get the random percentage value and select or deselect the component (by default) for     * installation */    GetPrivateProfileString(szComponentItem, "Random Install Percentage", "", szBuf, MAX_BUF, szFileIni);    if(*szBuf != '\0')    {      siCTemp->lRandomInstallPercentage = atol(szBuf);      if(siCTemp->lRandomInstallPercentage != 0)        siCTemp->lRandomInstallValue = RandomSelect();    }    /* get all dependencies for this component */    dwIndex1 = 0;    itoa(dwIndex1, szIndex1, 10);    lstrcpy(szDependency, "Dependency");    lstrcat(szDependency, szIndex1);    GetPrivateProfileString(szComponentItem, szDependency, "", szBuf, MAX_BUF, szFileIni);    while(*szBuf != '\0')    {      /* create and initialize empty node */      siCDepTemp = CreateSiCDepNode();      /* store name of archive for component */      lstrcpy(siCDepTemp->szDescriptionShort, szBuf);      /* inserts the newly created component into the global component queue */      SiCDepNodeInsert(&(siCTemp->siCDDependencies), siCDepTemp);      ++dwIndex1;      itoa(dwIndex1, szIndex1, 10);      lstrcpy(szDependency, "Dependency");      lstrcat(szDependency, szIndex1);      GetPrivateProfileString(szComponentItem, szDependency, "", szBuf, MAX_BUF, szFileIni);    }    /* get all dependees for this component */    dwIndex1 = 0;    itoa(dwIndex1, szIndex1, 10);    lstrcpy(szDependee, "Dependee");    lstrcat(szDependee, szIndex1);    GetPrivateProfileString(szComponentItem, szDependee, "", szBuf, MAX_BUF, szFileIni);    while(*szBuf != '\0')    {      /* create and initialize empty node */      siCDDependeeTemp = CreateSiCDepNode();      /* store name of archive for component */      lstrcpy(siCDDependeeTemp->szDescriptionShort, szBuf);      /* inserts the newly created component into the global component queue */      SiCDepNodeInsert(&(siCTemp->siCDDependees), siCDDependeeTemp);      ++dwIndex1;      itoa(dwIndex1, szIndex1, 10);      lstrcpy(szDependee, "Dependee");      lstrcat(szDependee, szIndex1);      GetPrivateProfileString(szComponentItem, szDependee, "", szBuf, MAX_BUF, szFileIni);    }    // locate previous path if necessary    lstrcpy(szDPSection, szComponentItem);    lstrcat(szDPSection, "-Destination Path");    if(LocatePreviousPath(szDPSection, siCTemp->szDestinationPath, MAX_PATH) == FALSE)      ZeroMemory(siCTemp->szDestinationPath, MAX_PATH);    /* inserts the newly created component into the global component queue */    SiCNodeInsert(&siComponents, siCTemp);    ++dwIndex0;    itoa(dwIndex0, szIndex0, 10);    lstrcpy(szComponentItem, "Component");    lstrcat(szComponentItem, szIndex0);    GetPrivateProfileString(szComponentItem, "Archive", "", szBuf, MAX_BUF, szFileIni);  }}