GetPrivateProfileString(szSection, "Message0", "", szMessage[0], MAX_BUF, szFileIniConfig); GetPrivateProfileString(szSection, "Message1", "", szMessage[1], MAX_BUF, szFileIniConfig); if((*szMessage[0] == '\0') && (*szMessage[1] == '\0'))
lstrcpy(szMessage[0], sgProduct.szPath); if(*sgProduct.szSubPath != '\0') { AppendBackSlash(szMessage[0], MAX_BUF); lstrcat(szMessage[0], sgProduct.szSubPath); }  GetPrivateProfileString(szSection, "Message0", "", szMessage[1], MAX_BUF, szFileIniConfig); GetPrivateProfileString(szSection, "Message1", "", szMessage[2], MAX_BUF, szFileIniConfig); if((*szMessage[1] == '\0') && (*szMessage[2] == '\0'))
BOOL CheckLegacy(HWND hDlg){  char      szSection[MAX_BUF];  char      szFilename[MAX_BUF];  LPSTR     szMessage[2];  char      szIndex[MAX_BUF];  char      szVersionNew[MAX_BUF];  char      szDecryptedFilePath[MAX_BUF];  int       iIndex;  BOOL      bContinue;  DWORD     dwRv0;  DWORD     dwRv1;  verBlock  vbVersionNew;  verBlock  vbVersionOld;  bContinue = TRUE;  iIndex    = -1;  while(bContinue)  {    ZeroMemory(szFilename,      sizeof(szFilename));    ZeroMemory(szVersionNew,    sizeof(szVersionNew));    ++iIndex;    itoa(iIndex, szIndex, 10);    lstrcpy(szSection, "Legacy Check");    lstrcat(szSection, szIndex);    dwRv0 = GetPrivateProfileString(szSection, "Filename", "", szFilename, MAX_BUF, szFileIniConfig);    dwRv1 = GetPrivateProfileString(szSection, "Version", "", szVersionNew, MAX_BUF, szFileIniConfig);    if(dwRv0 == 0L)    {      bContinue = FALSE;    }    else if(*szFilename != '\0')    {      if((szMessage[0] = NS_GlobalAlloc(MAX_BUF)) == NULL)        return(1);      if((szMessage[1] = NS_GlobalAlloc(MAX_BUF)) == NULL)        return(1);      GetPrivateProfileString(szSection, "Message0", "", szMessage[0], MAX_BUF, szFileIniConfig);      GetPrivateProfileString(szSection, "Message1", "", szMessage[1], MAX_BUF, szFileIniConfig);      if((*szMessage[0] == '\0') && (*szMessage[1] == '\0'))        /* no message string input. so just continue with the next check */        continue;      DecryptString(szDecryptedFilePath, szFilename);      if((dwRv1 == 0L) || (*szVersionNew == '\0'))      {        if(FileExists(szDecryptedFilePath))        {          MessageBeep(MB_ICONEXCLAMATION);          if((gdwUpgradeValue = DialogBoxParam(hSetupRscInst, MAKEINTRESOURCE(DLG_UPGRADE), hDlgCurrent, DlgProcUpgrade, (LPARAM)szMessage)) == UG_GOBACK)            return(TRUE);        }        /* file does not exist, so it's okay.  Continue with the next check */        continue;      }      if(GetFileVersion(szDecryptedFilePath, &vbVersionOld))      {        TranslateVersionStr(szVersionNew, &vbVersionNew);        if(CompareVersion(vbVersionOld, vbVersionNew) < 0)        {          MessageBeep(MB_ICONEXCLAMATION);          if((gdwUpgradeValue = DialogBoxParam(hSetupRscInst, MAKEINTRESOURCE(DLG_UPGRADE), hDlgCurrent, DlgProcUpgrade, (LPARAM)szMessage)) == UG_GOBACK)            return(TRUE);        }      }      FreeMemory(&szMessage[0]);      FreeMemory(&szMessage[1]);    }  }  /* returning TRUE means the user wants to go back and choose a different destination path   * returning FALSE means the user is ignoring the warning   */  return(FALSE);}