bSaveInstallerFiles = FALSE;
HRESULT Initialize(HINSTANCE hInstance){  char szBuf[MAX_BUF];  HWND hwndFW;  bSDInit             = FALSE;  bSDUserCanceled     = FALSE;  bSaveInstallerFiles = FALSE;  hDlgMessage         = NULL;  DetermineOSVersion();  /* load strings from setup.exe */  if(NS_LoadStringAlloc(hInstance, IDS_ERROR_GLOBALALLOC, &szEGlobalAlloc, MAX_BUF))    return(1);  if(NS_LoadStringAlloc(hInstance, IDS_ERROR_STRING_LOAD, &szEStringLoad,  MAX_BUF))    return(1);  if(NS_LoadStringAlloc(hInstance, IDS_ERROR_DLL_LOAD,    &szEDllLoad,     MAX_BUF))    return(1);  if(NS_LoadStringAlloc(hInstance, IDS_ERROR_STRING_NULL, &szEStringNull,  MAX_BUF))    return(1);  /* Allow only one instance of setup to run.   * Detect a previous instance of setup, bring it to the    * foreground, and quit current instance */  if((hwndFW = FindWindow(CLASS_NAME_SETUP, CLASS_NAME_SETUP)) != NULL)  {    ShowWindow(hwndFW, SW_RESTORE);    SetForegroundWindow(hwndFW);    return(1);  }  hAccelTable = LoadAccelerators(hInstance, CLASS_NAME_SETUP);  if((hSetupRscInst = LoadLibraryEx("Setuprsc.dll", NULL, LOAD_WITH_ALTERED_SEARCH_PATH)) == NULL)  {    wsprintf(szBuf, szEDllLoad, "SetupRsc.dll");    PrintError(szBuf, ERROR_CODE_HIDE);    return(1);  }  dwWizardState         = DLG_NONE;  dwTempSetupType       = dwWizardState;  siComponents          = NULL;  bCreateDestinationDir = FALSE;  bReboot               = FALSE;  gdwUpgradeValue       = UG_NONE;  if((szSetupDir = NS_GlobalAlloc(MAX_BUF)) == NULL)    return(1);  getcwd(szSetupDir, MAX_BUF);  if((szTempDir = NS_GlobalAlloc(MAX_BUF)) == NULL)    return(1);  if((szOSTempDir = NS_GlobalAlloc(MAX_BUF)) == NULL)    return(1);  if((szFileIniConfig = NS_GlobalAlloc(MAX_BUF)) == NULL)    return(1);  // determine the system's TEMP path  if(GetTempPath(MAX_BUF, szTempDir) == 0)  {    if(GetWindowsDirectory(szTempDir, MAX_BUF) == 0)    {      char szEGetWinDirFailed[MAX_BUF];      if(NS_LoadString(hSetupRscInst, IDS_ERROR_GET_WINDOWS_DIRECTORY_FAILED, szEGetWinDirFailed, MAX_BUF) == WIZ_OK)        PrintError(szEGetWinDirFailed, ERROR_CODE_SHOW);      return(1);    }    AppendBackSlash(szTempDir, MAX_BUF);    lstrcat(szTempDir, "TEMP");  }  lstrcpy(szOSTempDir, szTempDir);  AppendBackSlash(szTempDir, MAX_BUF);  lstrcat(szTempDir, WIZ_TEMP_DIR);  if(!FileExists(szTempDir))  {    AppendBackSlash(szTempDir, MAX_BUF);    CreateDirectoriesAll(szTempDir, FALSE);    if(!FileExists(szTempDir))    {      char szECreateTempDir[MAX_BUF];      if(NS_LoadString(hSetupRscInst, IDS_ERROR_CREATE_TEMP_DIR, szECreateTempDir, MAX_BUF) == WIZ_OK)      {        wsprintf(szBuf, szECreateTempDir, szTempDir);        PrintError(szBuf, ERROR_CODE_HIDE);      }      return(1);    }    RemoveBackSlash(szTempDir);  }  hbmpBoxChecked         = LoadBitmap(hSetupRscInst, MAKEINTRESOURCE(IDB_BOX_CHECKED));  hbmpBoxCheckedDisabled = LoadBitmap(hSetupRscInst, MAKEINTRESOURCE(IDB_BOX_CHECKED_DISABLED));  hbmpBoxUnChecked       = LoadBitmap(hSetupRscInst, MAKEINTRESOURCE(IDB_BOX_UNCHECKED));  DeleteIdiGetConfigIni();  bIdiArchivesExists = DeleteIdiGetArchives();  DeleteIdiGetRedirect();  return(0);}