Back to index

lightning-sunbird  0.9+nobinonly
Functions | Variables
setup.c File Reference
#include "setup.h"
#include "extra.h"
#include "dialogs.h"
#include "ifuncns.h"

Go to the source code of this file.

Functions

int APIENTRY WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)

Variables

HINSTANCE hInst
HINSTANCE hSetupRscInst
HINSTANCE hSDInst
HINSTANCE hXPIStubInst
HBITMAP hbmpBoxChecked
HBITMAP hbmpBoxCheckedDisabled
HBITMAP hbmpBoxUnChecked
HANDLE hAccelTable
HWND hDlgCurrent
HWND hDlgMessage
HWND hWndMain
HWND hWizardWnd
LPSTR szEGlobalAlloc
LPSTR szEStringLoad
LPSTR szEDllLoad
LPSTR szEStringNull
LPSTR szTempSetupPath
LPSTR szEOutOfMemory
LPSTR szSetupDir
LPSTR szTempDir
LPSTR szOSTempDir
LPSTR szFileIniInstall
LPSTR szSiteSelectorDescription
DWORD dwWizardState
DWORD dwSetupType
DWORD dwTempSetupType
DWORD gdwUpgradeValue
DWORD gdwSiteSelectorStatus
BOOL bSDUserCanceled
BOOL bIdiArchivesExists
BOOL bCreateDestinationDir
BOOL bReboot
BOOL gbILUseTemp
BOOL gbPreviousUnfinishedDownload
BOOL gbPreviousUnfinishedInstallXpi
BOOL gbIgnoreRunAppX
BOOL gbIgnoreProgramFolderX
BOOL gbRestrictedAccess
BOOL gbDownloadTriggered
BOOL gbAllowMultipleInstalls = FALSE
BOOL gbForceInstall = FALSE
BOOL gbForceInstallGre = FALSE
BOOL gShowBannerImage = TRUE
setupGen sgProduct
diS diSetup
diW diWelcome
diL diLicense
diQL diQuickLaunch
diST diSetupType
diSC diSelectComponents
diSIP diSelectInstallPath
diU diUpgrade
diSC diSelectAdditionalComponents
diWI diWindowsIntegration
diPF diProgramFolder
diDO diAdditionalOptions
diAS diAdvancedSettings
diSI diStartInstall
diDL diDownloading
diI diInstalling
diIS diInstallSuccessful
diD diDownload
diR diReboot
siSD siSDObject
siCF siCFXpcomFile
siC * siComponents
ssi * ssiSiteSelector
installGui sgInstallGui
sems gErrorMessageStream
sysinfo gSystemInfo
dsN * gdsnComponentDSRequirement = NULL
char * SetupFileList []

Function Documentation

int APIENTRY WinMain ( HINSTANCE  hInstance,
HINSTANCE  hPrevInstance,
LPSTR  lpszCmdLine,
int  nCmdShow 
)

Definition at line 138 of file setup.c.

{
  /***********************************************************************/
  /* HANDLE hInstance;       handle for this instance                    */
  /* HANDLE hPrevInstance;   handle for possible previous instances      */
  /* LPSTR  lpszCmdLine;     long pointer to exec command line           */
  /* int    nCmdShow;        Show code for main window display           */
  /***********************************************************************/

  MSG   msg;
  char  szBuf[MAX_BUF];
  int   iRv = WIZ_OK;
  HWND  hwndFW;

  if(!hPrevInstance)
  {
    if(InitSetupGeneral())
      PostQuitMessage(1);
    else if(ParseForStartupOptions(lpszCmdLine))
      PostQuitMessage(1);
    else if(((hwndFW = FindWindow(CLASS_NAME_SETUP_DLG, NULL)) != NULL ||
            ((hwndFW = FindWindow(CLASS_NAME_SETUP, NULL)) != NULL)) &&
              !gbAllowMultipleInstalls)
    {
    /* Allow only one instance of setup to run.
     * Detect a previous instance of setup, bring it to the 
     * foreground, and quit current instance */

      ShowWindow(hwndFW, SW_RESTORE);
      SetForegroundWindow(hwndFW);
      iRv = WIZ_SETUP_ALREADY_RUNNING;
      PostQuitMessage(1);
    }
    else if(Initialize(hInstance))
      PostQuitMessage(1);
    else if(!InitApplication(hInstance, hSetupRscInst))
    {
      char szEFailed[MAX_BUF];

      if(GetPrivateProfileString("Messages", "ERROR_FAILED", "", szEFailed, sizeof(szEFailed), szFileIniInstall))
      {
        wsprintf(szBuf, szEFailed, "InitApplication().");
        PrintError(szBuf, ERROR_CODE_SHOW);
      }
      PostQuitMessage(1);
    }
    else if(!InitInstance(hInstance, nCmdShow))
    {
      char szEFailed[MAX_BUF];

      if(GetPrivateProfileString("Messages", "ERROR_FAILED", "", szEFailed, sizeof(szEFailed), szFileIniInstall))
      {
        wsprintf(szBuf, szEFailed, "InitInstance().");
        PrintError(szBuf, ERROR_CODE_SHOW);
      }
      PostQuitMessage(1);
    }
    else if(GetInstallIni())
    {
      PostQuitMessage(1);
    }
    else if(ParseInstallIni())
    {
      PostQuitMessage(1);
    }
    else if(GetConfigIni())
    {
      PostQuitMessage(1);
    }
    else if(ParseConfigIni(lpszCmdLine))
    {
      PostQuitMessage(1);
    }
    else
    {
      InitSequence(hInstance);
    }
  }

#if 0
  while(GetMessage(&msg, NULL, 0, 0))
  {
    if((!IsDialogMessage(hDlgCurrent, &msg)) && (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)))
    {
      TranslateMessage(&msg);
      DispatchMessage(&msg);
    }
  }

  if(iRv != WIZ_SETUP_ALREADY_RUNNING)
    /* Do clean up before exiting from the application */
    DeInitialize();

  /* garbage collection */
  DeInitSetupGeneral();

  return(msg.wParam);
#endif

  return 0;
} 

Here is the call graph for this function:


Variable Documentation

Definition at line 85 of file setup.c.

Definition at line 84 of file setup.c.

Definition at line 86 of file setup.c.

Definition at line 83 of file setup.c.

Definition at line 111 of file setup.c.

Definition at line 112 of file setup.c.

Definition at line 117 of file setup.c.

Definition at line 114 of file setup.c.

Definition at line 115 of file setup.c.

Definition at line 116 of file setup.c.

Definition at line 102 of file setup.c.

Definition at line 110 of file setup.c.

Definition at line 103 of file setup.c.

Definition at line 118 of file setup.c.

Definition at line 108 of file setup.c.

Definition at line 105 of file setup.c.

Definition at line 106 of file setup.c.

Definition at line 100 of file setup.c.

Definition at line 104 of file setup.c.

Definition at line 113 of file setup.c.

Definition at line 107 of file setup.c.

Definition at line 101 of file setup.c.

Definition at line 109 of file setup.c.

Definition at line 77 of file setup.c.

Definition at line 79 of file setup.c.

Definition at line 76 of file setup.c.

Definition at line 94 of file setup.c.

Definition at line 93 of file setup.c.

Definition at line 95 of file setup.c.

Definition at line 96 of file setup.c.

Definition at line 91 of file setup.c.

Definition at line 90 of file setup.c.

Definition at line 87 of file setup.c.

Definition at line 88 of file setup.c.

Definition at line 89 of file setup.c.

Definition at line 92 of file setup.c.

Definition at line 126 of file setup.c.

Definition at line 81 of file setup.c.

Definition at line 80 of file setup.c.

Definition at line 124 of file setup.c.

Definition at line 97 of file setup.c.

sysinfo gSystemInfo

Definition at line 125 of file setup.c.

Definition at line 55 of file setup.c.

HBITMAP hbmpBoxChecked

Definition at line 51 of file setup.c.

Definition at line 52 of file setup.c.

Definition at line 53 of file setup.c.

Definition at line 57 of file setup.c.

Definition at line 58 of file setup.c.

Definition at line 46 of file setup.c.

Definition at line 48 of file setup.c.

Definition at line 47 of file setup.c.

Definition at line 60 of file setup.c.

Definition at line 59 of file setup.c.

Definition at line 49 of file setup.c.

char* SetupFileList[]
Initial value:
 {"setuprsc.dll",
                         "config.ini",
                         "setup.ini",
                         "install.ini",
                         "license.txt",
                         ""}

Definition at line 131 of file setup.c.

Definition at line 123 of file setup.c.

Definition at line 99 of file setup.c.

Definition at line 120 of file setup.c.

Definition at line 121 of file setup.c.

Definition at line 119 of file setup.c.

Definition at line 122 of file setup.c.

Definition at line 64 of file setup.c.

Definition at line 62 of file setup.c.

Definition at line 67 of file setup.c.

Definition at line 63 of file setup.c.

Definition at line 65 of file setup.c.

Definition at line 72 of file setup.c.

Definition at line 71 of file setup.c.

Definition at line 69 of file setup.c.

Definition at line 74 of file setup.c.

Definition at line 70 of file setup.c.

Definition at line 66 of file setup.c.