CleanupCoreFile(); PostQuitMessage(0);
void DlgSequenceNext(){  HRESULT hrValue;  switch(dwWizardState)  {    case DLG_NONE:      dwWizardState = DLG_WELCOME;      if(diWelcome.bShowDialog)        InstantiateDialog(dwWizardState, diWelcome.szTitle, DlgProcWelcome);      else        PostMessage(hWndMain, WM_COMMAND, ID_WIZNEXT, 0);      break;    case DLG_WELCOME:      dwWizardState = DLG_LICENSE;      if(diLicense.bShowDialog)        InstantiateDialog(dwWizardState, diLicense.szTitle, DlgProcLicense);      else        PostMessage(hWndMain, WM_COMMAND, ID_WIZNEXT, 0);      break;    case DLG_LICENSE:      dwWizardState = DLG_SETUP_TYPE;      if(diSetupType.bShowDialog)        InstantiateDialog(dwWizardState, diSetupType.szTitle, DlgProcSetupType);      else      {        CheckWizardStateCustom(DLG_SELECT_COMPONENTS);        PostMessage(hWndMain, WM_COMMAND, ID_WIZNEXT, 0);      }      break;    case DLG_SETUP_TYPE:      /* depending on what the users chooses, the Select Components dialog  */      /* might not be the next dialog in the sequence.                      */      dwWizardState = DLG_SELECT_COMPONENTS;      if(diSelectComponents.bShowDialog)        InstantiateDialog(dwWizardState, diSelectComponents.szTitle, DlgProcSelectComponents);      else        PostMessage(hWndMain, WM_COMMAND, ID_WIZNEXT, 0);      break;    case DLG_SELECT_COMPONENTS:      dwWizardState = DLG_WINDOWS_INTEGRATION;      if(diWindowsIntegration.bShowDialog)        InstantiateDialog(dwWizardState, diWindowsIntegration.szTitle, DlgProcWindowsIntegration);      else        PostMessage(hWndMain, WM_COMMAND, ID_WIZNEXT, 0);      break;    case DLG_WINDOWS_INTEGRATION:      dwWizardState = DLG_PROGRAM_FOLDER;      do      {        hrValue = VerifyDiskSpace();        if(hrValue == FALSE)        {          /* show previous visible window */          DlgSequencePrev();          break;        }      }while(hrValue == IDRETRY);      if(hrValue == FALSE)      {        /* break out of this case because we need to show the previous dialog */        break;      }      if(diProgramFolder.bShowDialog)        InstantiateDialog(dwWizardState, diProgramFolder.szTitle, DlgProcProgramFolder);      else        PostMessage(hWndMain, WM_COMMAND, ID_WIZNEXT, 0);      break;    case DLG_PROGRAM_FOLDER:      dwWizardState = DLG_START_INSTALL;      if(diStartInstall.bShowDialog)        InstantiateDialog(dwWizardState, diStartInstall.szTitle, DlgProcStartInstall);      else        PostMessage(hWndMain, WM_COMMAND, ID_WIZNEXT, 0);      break;    default:      dwWizardState = DLG_START_INSTALL;      /* PRE_DOWNLOAD process file manipulation functions */      ProcessFileOps(T_PRE_DOWNLOAD);      if(RetrieveArchives() == 0)      {        /* POST_DOWNLOAD process file manipulation functions */        ProcessFileOps(T_POST_DOWNLOAD);        /* PRE_CORE process file manipulation functions */        ProcessFileOps(T_PRE_CORE);        ProcessCoreFile();        /* POST_CORE process file manipulation functions */        ProcessFileOps(T_POST_CORE);        /* PRE_SMARTUPDATE process file manipulation functions */        ProcessFileOps(T_PRE_SMARTUPDATE);        if(SmartUpdateJars() == 0)        {          /* POST_SMARTUPDATE process file manipulation functions */          ProcessFileOps(T_POST_SMARTUPDATE);          /* PRE_LAUNCHAPP process file manipulation functions */          ProcessFileOps(T_PRE_LAUNCHAPP);          LaunchApps();          /* POST_LAUNCHAPP process file manipulation functions */          ProcessFileOps(T_POST_LAUNCHAPP);          ProcessProgramFolderShowCmd();          if(diReboot.dwShowDialog)          {            CleanupCoreFile();            InstantiateDialog(DLG_RESTART, diReboot.szTitle, DlgProcReboot);          }        }      }      else        bSDUserCanceled = TRUE;      CleanupCoreFile();      PostQuitMessage(0);      break;  }}