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 main (int argc, char *argv[], char *envp[])

Variables

HINSTANCE hSetupRscInst
HINSTANCE hXPIStubInst
HWND hDlgCurrent
HWND hDlgMessage
HWND hWndMain
LPSTR szEGlobalAlloc
LPSTR szEStringLoad
LPSTR szEDllLoad
LPSTR szEStringNull
LPSTR szTempSetupPath
LPSTR szSetupDir
LPSTR szTempDir
LPSTR szOSTempDir
LPSTR szFileIniConfig
LPSTR szFileIniInstall
LPSTR szSiteSelectorDescription
DWORD ulWizardState
ULONG ulSetupType
LONG lScreenX
LONG lScreenY
DWORD ulTempSetupType
DWORD gulUpgradeValue
DWORD gulSiteSelectorStatus
BOOL bSDUserCanceled
BOOL bIdiArchivesExists
BOOL bCreateDestinationDir
BOOL bReboot
BOOL gbILUseTemp
BOOL gbPreviousUnfinishedDownload
BOOL gbPreviousUnfinishedInstallXpi
BOOL gbIgnoreRunAppX
BOOL gbIgnoreProgramFolderX
BOOL gbDownloadTriggered
setupGen sgProduct
diS diSetup
diW diWelcome
diL diLicense
diQL diQuickLaunch
diST diSetupType
diSC diSelectComponents
diSC diSelectAdditionalComponents
diOI diOS2Integration
diPF diProgramFolder
diDO diAdditionalOptions
diAS diAdvancedSettings
diSI diStartInstall
diD diDownload
diR diReboot
siCF siCFXpcomFile
siC * siComponents
ssi * ssiSiteSelector
installGui sgInstallGui
sems gErrorMessageStream
sysinfo gSystemInfo
dsN * gdsnComponentDSRequirement = NULL
char * SetupFileList []

Function Documentation

int main ( int  argc,
char *  argv[],
char *  envp[] 
)

Definition at line 119 of file setup.c.

{
  HAB hab;
  HMQ hmq;
  QMSG qmsg;
  char  szBuf[MAX_BUF];
  int   iRv = WIZ_OK;
  HWND  hwndFW;
  int rc = 0;
  ATOM atom;

  hab = WinInitialize( 0 );
  hmq = WinCreateMsgQueue( hab, 0 );

  atom = WinAddAtom(WinQuerySystemAtomTable(), CLASS_NAME_SETUP_DLG);

  /* Allow only one instance of setup to run.
   * Detect a previous instance of setup, bring it to the 
   * foreground, and quit current instance */

  /* Iterate over top level windows searching for one of the required class
   * and a matching title.
   */
  if((hwndFW = FindWindow(CLASS_NAME_SETUP_DLG)) != NULL)
  {
    WinSetActiveWindow(HWND_DESKTOP, hwndFW);
    iRv = WIZ_SETUP_ALREADY_RUNNING;
    WinPostQueueMsg(0, WM_QUIT, 1, 0);
  }
  else if(Initialize(0, argv[0]))
    WinPostQueueMsg(0, WM_QUIT, 1, 0);
  else if(!InitApplication())
  {
    char szEFailed[MAX_BUF];

    if(GetPrivateProfileString("Messages", "ERROR_FAILED", "", szEFailed, sizeof(szEFailed), szFileIniInstall))
    {
      sprintf(szBuf, szEFailed, "InitApplication().");
      PrintError(szBuf, ERROR_CODE_SHOW);
    }
    WinPostQueueMsg(0, WM_QUIT, 1, 0);
  }
  else if(!InitInstance())
  {
    char szEFailed[MAX_BUF];

    if(GetPrivateProfileString("Messages", "ERROR_FAILED", "", szEFailed, sizeof(szEFailed), szFileIniInstall))
    {
      sprintf(szBuf, szEFailed, "InitInstance().");
      PrintError(szBuf, ERROR_CODE_SHOW);
    }
    WinPostQueueMsg(0, WM_QUIT, 1, 0);
  }
  else if(GetInstallIni())
  {
    WinPostQueueMsg(0, WM_QUIT, 1, 0);
  }
  else if(ParseInstallIni())
  {
    WinPostQueueMsg(0, WM_QUIT, 1, 0);
  }
  else if(GetConfigIni())
  {
    WinPostQueueMsg(0, WM_QUIT, 1, 0);
  }
  else if(ParseConfigIni(argc, argv))
  {
    WinPostQueueMsg(0, WM_QUIT, 1, 0);
  }
  else
  {
    DlgSequence(NEXT_DLG);
  }

  while ( WinGetMsg( hab, &qmsg, NULLHANDLE, 0, 0 ) )
    WinDispatchMsg( hab, &qmsg );

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

  WinDeleteAtom(WinQuerySystemAtomTable(), atom);

  WinDestroyMsgQueue( hmq );
  WinTerminate( hab ); 

  /* Unset LIBPATHSTRICT just in case it didn't get unset elsewhere */
  DosSetExtLIBPATH("F", LIBPATHSTRICT);
}

Here is the call graph for this function:


Variable Documentation

Definition at line 78 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 97 of file setup.c.

Definition at line 98 of file setup.c.

Definition at line 100 of file setup.c.

Definition at line 90 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 101 of file setup.c.

Definition at line 94 of file setup.c.

Definition at line 93 of file setup.c.

Definition at line 88 of file setup.c.

Definition at line 92 of file setup.c.

Definition at line 99 of file setup.c.

Definition at line 89 of file setup.c.

Definition at line 85 of file setup.c.

Definition at line 84 of file setup.c.

Definition at line 83 of file setup.c.

Definition at line 80 of file setup.c.

Definition at line 81 of file setup.c.

Definition at line 82 of file setup.c.

Definition at line 108 of file setup.c.

Definition at line 106 of file setup.c.

sysinfo gSystemInfo

Definition at line 107 of file setup.c.

Definition at line 74 of file setup.c.

Definition at line 73 of file setup.c.

Definition at line 49 of file setup.c.

Definition at line 50 of file setup.c.

Definition at line 46 of file setup.c.

Definition at line 51 of file setup.c.

Definition at line 47 of file setup.c.

Definition at line 69 of file setup.c.

Definition at line 70 of file setup.c.

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

Definition at line 112 of file setup.c.

Definition at line 105 of file setup.c.

Definition at line 87 of file setup.c.

Definition at line 102 of file setup.c.

Definition at line 103 of file setup.c.

Definition at line 104 of file setup.c.

Definition at line 55 of file setup.c.

Definition at line 53 of file setup.c.

Definition at line 54 of file setup.c.

Definition at line 56 of file setup.c.

Definition at line 62 of file setup.c.

Definition at line 63 of file setup.c.

Definition at line 61 of file setup.c.

Definition at line 59 of file setup.c.

Definition at line 65 of file setup.c.

Definition at line 60 of file setup.c.

Definition at line 57 of file setup.c.

Definition at line 68 of file setup.c.

Definition at line 72 of file setup.c.

Definition at line 67 of file setup.c.