sgProduct.doCleanupOnUpgrade = TRUE;
sgProduct.doCleanupOnUpgrade = DEFAULT_SAFE_UPGRADE;
void CheckForUpgrade(HWND aPanel, int aNextPanel){  char buf[MAX_BUF];  int nextPanel = aNextPanel;  // Check to see if we should show the "Safe Upgrade" dialog  // The second part of the test is to see if the flag in config.ini  // specifies whether or not this should be shown *specifically* in the  // "Easy Install" mode. If that flag is set to FALSE, the Upgrade   // panel is shown only in the "Custom"/"Advanced" pass.   if (sgProduct.checkCleanupOnUpgrade &&       !(dwSetupType == ST_RADIO0 && !diUpgrade.bShowInEasyInstall)) {    // Found destination folder.  check to see if we're upgrading ontop    // of a previous installation.  If so, we need to prompt the user    // about removing the entire dir before installation happens.    MozCopyStr(sgProduct.szPath, buf, sizeof(buf));    AppendBackSlash(buf, sizeof(buf));    lstrcat(buf, sgProduct.szProgramName);    if (FileExists(buf)) {      // Prompt user if deleting target path is okay. Only show      // prompt if the setup is running in normal mode, else      // assume user wants deletion.      if(sgProduct.mode == NORMAL)        nextPanel = DLG_UPGRADE;      else {        sgProduct.doCleanupOnUpgrade = TRUE;        nextPanel = aNextPanel;      }    }    else      nextPanel = aNextPanel;  }  /* SiCNodeSetItemsSelected() is called from within DlgProcUpgrade().   * If DlgProcUpgrade is not called (in the case of a !NORMAL install),   * then we need to call it here. */  if (sgProduct.mode != NORMAL)    SiCNodeSetItemsSelected(dwSetupType);  gDidShowUpgradePanel = nextPanel == DLG_UPGRADE;  SetWindowLong(aPanel, DWL_MSGRESULT, nextPanel);}