HWND	hWnd = FindWindow("ISINSTALLSCLASS", NULL);
DestroyWindow(dlgInfo.hWndDlg);
RunInstaller(){  PROCESS_INFORMATION pi;  STARTUPINFO         sti;  char                szCmdLine[MAX_BUF];  char                szSetupFile[MAX_BUF];  char                szUninstallFile[MAX_BUF];  char                szArcLstFile[MAX_BUF];  BOOL                bRet;  char                szText[256];  char                szTempPath[4096];  char                szTmp[MAX_PATH];  char                szCurrentDirectory[MAX_PATH];  char                szBuf[MAX_PATH];  DWORD               dwLen;  // Update UI  UpdateProgressBar(100);  LoadString(hInst, IDS_STATUS_LAUNCHING_SETUP, szText, sizeof(szText));  SetStatusLine(szText);  memset(&sti,0,sizeof(sti));  sti.cb = sizeof(STARTUPINFO);  dwLen = GetTempPath(4096, szTempPath);  if (szTempPath[dwLen - 1] != '\\')    strcat(szTempPath, "\\");  strcat(szTempPath, WIZ_TEMP_DIR);  // Setup program is in the directory specified for temporary files	GetFullTempPathName("Archive.lst",   sizeof(szArcLstFile),    szArcLstFile);  GetFullTempPathName("SETUP.EXE",     sizeof(szSetupFile),     szSetupFile);  GetFullTempPathName("uninstall.exe", sizeof(szUninstallFile), szUninstallFile);  GetPrivateProfileString("Archives", "uninstall.exe", "", szBuf, sizeof(szBuf), szArcLstFile);  if((FileExists(szUninstallFile) != FALSE) && (*szBuf != '\0'))  {    lstrcpy(szCmdLine, szUninstallFile);  }  else  {    lstrcpy(szCmdLine, szSetupFile);    GetCurrentDirectory(MAX_PATH, szCurrentDirectory);    GetShortPathName(szCurrentDirectory, szBuf, MAX_PATH);    lstrcat(szCmdLine, " -a ");    lstrcat(szCmdLine, szBuf);  }  if(szCmdLine != NULL)    lstrcat(szCmdLine, szCmdLineToSetup);  // Launch the installer  bRet = CreateProcess(NULL, szCmdLine, NULL, NULL, FALSE, 0, NULL, szTempPath, &sti, &pi);  if (!bRet)    return FALSE;  CloseHandle(pi.hThread);  // Wait for the InstallShield UI to appear before taking down the dialog box  WaitForInputIdle(pi.hProcess, 3000);  // wait up to 3 seconds  if(dwMode != SILENT)  {    DestroyWindow(dlgInfo.hWndDlg);  }  // Wait for the installer to complete  WaitForSingleObject(pi.hProcess, INFINITE);  CloseHandle(pi.hProcess);  // That was just the installer bootstrapper. Now we need to wait for the  // installer itself. We can find the process ID by looking for a window of  // class ISINSTALLSCLASS  HWND	hWnd = FindWindow("ISINSTALLSCLASS", NULL);  if (hWnd) {    DWORD	dwProcessId;    HANDLE	hProcess;    // Get the associated process handle and wait for it to terminate    GetWindowThreadProcessId(hWnd, &dwProcessId);    // We need the process handle to use WaitForSingleObject    hProcess = OpenProcess(STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE, FALSE, dwProcessId);    if (hProcess) {      WaitForSingleObject(hProcess, INFINITE);      CloseHandle(hProcess);    }  }  // Delete the files from the temp directory  EnumResourceNames(NULL, "FILE", (ENUMRESNAMEPROC)DeleteTempFilesProc, 0);  // delete archive.lst file in the temp directory  GetFullTempPathName("Archive.lst", sizeof(szTmp), szTmp);  DeleteFile(szTmp);  GetFullTempPathName("xpcom.ns", sizeof(szTmp), szTmp);  DirectoryRemove(szTmp, TRUE);  DirectoryRemove(szTempPath, FALSE);  return TRUE;}