itoa(dwFileCounter, szFileCounter, 10); lstrcpy(szSFile, "File"); lstrcat(szSFile, szFileCounter);
wsprintf(szSection, "File%d", dwFileCounter);
int CRCCheckDownloadedArchives(char *szCorruptedArchiveList,                               DWORD dwCorruptedArchiveListSize,                               char *szFileIdiGetArchives){  DWORD dwIndex0;  DWORD dwFileCounter;  siC   *siCObject = NULL;  char  szArchivePathWithFilename[MAX_BUF];  char  szArchivePath[MAX_BUF];  char  szMsgCRCCheck[MAX_BUF];  char  szSFile[MAX_INI_SK];  char  szFileCounter[MAX_ITOA];  int   iRv;  int   iResult;  /* delete the getarchives.idi file because it needs to be recreated   * if there are any files that fails the CRC check */  if(szFileIdiGetArchives)    DeleteFile(szFileIdiGetArchives);  if(szCorruptedArchiveList != NULL)    ZeroMemory(szCorruptedArchiveList, dwCorruptedArchiveListSize);  GetPrivateProfileString("Strings", "Message Verifying Archives", "", szMsgCRCCheck, sizeof(szMsgCRCCheck), szFileIniConfig);  ShowMessage(szMsgCRCCheck, TRUE);    iResult           = WIZ_CRC_PASS;  dwIndex0          = 0;  dwFileCounter     = 0;  siCObject = SiCNodeGetObject(dwIndex0, TRUE, AC_ALL);  while(siCObject)  {    if(siCObject->dwAttributes & SIC_SELECTED)    {      /* only download jars if not already in the local machine */      if((iRv = LocateJar(siCObject, szArchivePath, sizeof(szArchivePath), TRUE)) == AP_NOT_FOUND)      {        char szBuf[MAX_BUF];        char szEFileNotFound[MAX_BUF];        if(NS_LoadString(hSetupRscInst, IDS_ERROR_FILE_NOT_FOUND, szEFileNotFound, MAX_BUF) == WIZ_OK)        {          wsprintf(szBuf, szEFileNotFound, siCObject->szArchiveName);          PrintError(szBuf, ERROR_CODE_HIDE);        }        iResult = WIZ_ARCHIVES_MISSING; // not all .xpi files were downloaded        break;      }      if(lstrlen(szArchivePath) < sizeof(szArchivePathWithFilename))        lstrcpy(szArchivePathWithFilename, szArchivePath);      AppendBackSlash(szArchivePathWithFilename, sizeof(szArchivePathWithFilename));      if((lstrlen(szArchivePathWithFilename) + lstrlen(siCObject->szArchiveName)) < sizeof(szArchivePathWithFilename))        lstrcat(szArchivePathWithFilename, siCObject->szArchiveName);      if(CheckForArchiveExtension(szArchivePathWithFilename))      {        /* Make sure that the Archive that failed is located in the TEMP         * folder.  This means that it was downloaded at one point and not         * simply uncompressed from the self-extracting exe file. */        if(VerifyArchive(szArchivePathWithFilename) != ZIP_OK)        {          if(iRv == AP_TEMP_PATH)          {            /* Delete the archive even though the download lib will automatically             * overwrite the file.  This is in case that Setup is canceled, at the             * next restart, the file will be downloaded during the first attempt,             * not after a VerifyArchive() call. */            DeleteFile(szArchivePathWithFilename);            itoa(dwFileCounter, szFileCounter, 10);            lstrcpy(szSFile, "File");            lstrcat(szSFile, szFileCounter);            ++dwFileCounter;            if(szFileIdiGetArchives)              if((AddArchiveToIdiFile(siCObject, szSFile, szFileIdiGetArchives)) != 0)                return(WIZ_ERROR_UNDEFINED);            if(szCorruptedArchiveList != NULL)            {              if((DWORD)(lstrlen(szCorruptedArchiveList) + lstrlen(siCObject->szArchiveName + 1)) < dwCorruptedArchiveListSize)              {                lstrcat(szCorruptedArchiveList, "        ");                lstrcat(szCorruptedArchiveList, siCObject->szArchiveName);                lstrcat(szCorruptedArchiveList, "\n");              }            }          }          iResult = WIZ_CRC_FAIL;        }      }    }    ++dwIndex0;    siCObject = SiCNodeGetObject(dwIndex0, TRUE, AC_ALL);  }  ShowMessage(szMsgCRCCheck, FALSE);  return(iResult);}