integrate the reboot dialog into the wizard
Modified: trunk/reactos/lib/syssetup/install.c
Modified: trunk/reactos/lib/syssetup/resource.h
Modified: trunk/reactos/lib/syssetup/syssetup_Cz.rc
Modified: trunk/reactos/lib/syssetup/syssetup_De.rc
Modified: trunk/reactos/lib/syssetup/syssetup_En.rc
Modified: trunk/reactos/lib/syssetup/syssetup_Fr.rc
Modified: trunk/reactos/lib/syssetup/syssetup_Ja.rc
Modified: trunk/reactos/lib/syssetup/syssetup_Nl.rc
Modified: trunk/reactos/lib/syssetup/wizard.c

Modified: trunk/reactos/lib/syssetup/install.c
--- trunk/reactos/lib/syssetup/install.c	2005-10-27 22:16:52 UTC (rev 18812)
+++ trunk/reactos/lib/syssetup/install.c	2005-10-27 22:33:17 UTC (rev 18813)
@@ -50,9 +50,7 @@
 #include "globals.h"
 #include "resource.h"
 
-#define VMWINST
 
-
 /* GLOBALS ******************************************************************/
 
 PSID DomainSid = NULL;
@@ -80,30 +78,6 @@
 }
 
 
-#ifdef VMWINST
-static BOOL
-RunVMWInstall(VOID)
-{
-  PROCESS_INFORMATION ProcInfo;
-  STARTUPINFO si;
-  WCHAR InstallName[] = L"vmwinst.exe";
-
-  ZeroMemory(&si, sizeof(STARTUPINFO));
-  si.cb = sizeof(STARTUPINFO);
-
-  if(CreateProcess(NULL, InstallName, NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS,
-                   NULL, NULL, &si, &ProcInfo))
-  {
-    WaitForSingleObject(ProcInfo.hProcess, INFINITE);
-    CloseHandle(ProcInfo.hThread);
-    CloseHandle(ProcInfo.hProcess);
-    return TRUE;
-  }
-  return FALSE;
-}
-#endif
-
-
 HRESULT CreateShellLink(LPCTSTR linkPath, LPCTSTR cmd, LPCTSTR arg, LPCTSTR dir, LPCTSTR iconPath, int icon_nr, LPCTSTR comment)
 {
   IShellLink* psl;
@@ -561,15 +535,6 @@
 
   SetupCloseInfFile(hSysSetupInf);
 
-#ifdef VMWINST
-  RunVMWInstall();
-#endif
-
-  DialogBox(hDllInstance,
-	    MAKEINTRESOURCE(IDD_RESTART),
-	    NULL,
-	    RestartDlgProc);
-
   return 0;
 }
 

Modified: trunk/reactos/lib/syssetup/resource.h
--- trunk/reactos/lib/syssetup/resource.h	2005-10-27 22:16:52 UTC (rev 18812)
+++ trunk/reactos/lib/syssetup/resource.h	2005-10-27 22:33:17 UTC (rev 18813)
@@ -57,11 +57,8 @@
 
 #define IDD_FINISHPAGE			1070
 #define IDC_FINISHTITLE			1071
+#define IDC_RESTART_PROGRESS	1072
 
-
-#define IDD_RESTART				2000
-#define IDC_RESTART_PROGRESS	2001
-
 #define IDD_GPL                 2100
 #define IDC_GPL_TEXT            2101
 

Modified: trunk/reactos/lib/syssetup/syssetup_Cz.rc
--- trunk/reactos/lib/syssetup/syssetup_Cz.rc	2005-10-27 22:16:52 UTC (rev 18812)
+++ trunk/reactos/lib/syssetup/syssetup_Cz.rc	2005-10-27 22:33:17 UTC (rev 18813)
@@ -144,24 +144,12 @@
     LTEXT "Completing the ReactOS Setup Wizard",IDC_FINISHTITLE,115,9,195,37
     LTEXT "You have successfully completed ReactOS Setup.\n\n" \
           "When you click Finish, your computer will restart.", IDC_STATIC, 115, 58, 195, 100
+    CONTROL "", IDC_RESTART_PROGRESS, "msctls_progress32", PBS_SMOOTH | WS_CHILD | WS_VISIBLE | WS_BORDER, 115, 138, 188, 12
     LTEXT "If there is a CD in a drive, remove it. Then, to restart "\
           "your computer, click Finish.", IDC_STATIC, 115, 160, 195, 31
 END
 
 
-IDD_RESTART DIALOG 6, 18, 245, 116
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION
-CAPTION "Instatalace ReactOSu"
-FONT 8, "MS Shell Dlg"
-BEGIN
-    LTEXT "Instalace ReactOSu byla ·spýÜný dokonÞena.", -1, 13, 12, 212, 16
-    LTEXT "Pro pokraÞovßnÝ pot°ebuje instalaÞnÝ program restartovat VßÜ poÞÝtaÞ. PoÞÝtaÞ bude automaticky restartovßn za 15 sekund nebo zmßÞknete-li tlaÞÝtko Restartovat.", -1, 13, 33, 212, 32
-/*    GROUPBOX "", -1, 7, 3, 231, 106 */
-    CONTROL "", IDC_RESTART_PROGRESS, "msctls_progress32", PBS_SMOOTH | WS_CHILD | WS_VISIBLE | WS_BORDER, 13, 70, 212, 8 
-    PUSHBUTTON "&Restartovat", IDOK, 98, 87, 50, 14
-END
-
-
 IDD_GPL DIALOG 0, 0, 333, 230
 STYLE DS_CENTER | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "GNU General Public License"

Modified: trunk/reactos/lib/syssetup/syssetup_De.rc
--- trunk/reactos/lib/syssetup/syssetup_De.rc	2005-10-27 22:16:52 UTC (rev 18812)
+++ trunk/reactos/lib/syssetup/syssetup_De.rc	2005-10-27 22:33:17 UTC (rev 18813)
@@ -146,26 +146,12 @@
     LTEXT "Fertigstellung des ReactOS Setup Assistenten",IDC_FINISHTITLE,115,9,195,37
     LTEXT "Das ReactOS Setup wurde erfolgreich fertiggestellt.\n\n" \
           "Wenn Sie auf Fertig klicken, wird der Computer neu gestartet.", IDC_STATIC, 115, 58, 195, 100
+    CONTROL "", IDC_RESTART_PROGRESS, "msctls_progress32", PBS_SMOOTH | WS_CHILD | WS_VISIBLE | WS_BORDER, 115, 138, 188, 12
     LTEXT "Entfernen Sie die CD, wenn vorhanden. Danach klicken Sie "\
           "auf Fertig, um den Computer neu zu starten.", IDC_STATIC, 115, 160, 195, 31
 END
 
 
-IDD_RESTART DIALOG 6, 18, 245, 116
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION
-CAPTION "ReactOS Installation"
-FONT 8, "MS Shell Dlg"
-BEGIN
-    LTEXT "Die Installation von ReactOS wurde erfolgreich fertiggestellt.", IDC_STATIC, 13, 12, 212, 16
-    LTEXT "Um fortzufahren muss Ihr Computer neu gestartet werden. "\
-          "Der Computer wird in 15 Minuten automatisch neu gestartet oder wenn Sie auf "\
-          "Neustart klicken.", IDC_STATIC, 13, 33, 212, 32
-/*    GROUPBOX "", -1, 7, 3, 231, 106 */
-    CONTROL "", IDC_RESTART_PROGRESS, "msctls_progress32", PBS_SMOOTH | WS_CHILD | WS_VISIBLE | WS_BORDER, 13, 70, 212, 8 
-    PUSHBUTTON "&Neustart", IDOK, 98, 87, 50, 14
-END
-
-
 IDD_GPL DIALOG 0, 0, 333, 230
 STYLE DS_CENTER | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "GNU General Public License"

Modified: trunk/reactos/lib/syssetup/syssetup_En.rc
--- trunk/reactos/lib/syssetup/syssetup_En.rc	2005-10-27 22:16:52 UTC (rev 18812)
+++ trunk/reactos/lib/syssetup/syssetup_En.rc	2005-10-27 22:33:17 UTC (rev 18813)
@@ -147,26 +147,12 @@
     LTEXT "Completing the ReactOS Setup Wizard", IDC_FINISHTITLE, 115, 8, 195, 24
     LTEXT "You have successfully completed ReactOS Setup.\n\n" \
           "When you click Finish, your computer will restart.", IDC_STATIC, 115, 40, 195, 100
+    CONTROL "", IDC_RESTART_PROGRESS, "msctls_progress32", PBS_SMOOTH | WS_CHILD | WS_VISIBLE | WS_BORDER, 115, 138, 188, 12
     LTEXT "If there is a CD in a drive, remove it. Then, to restart "\
           "your computer, click Finish.", IDC_STATIC, 115, 169, 195, 17
 END
 
 
-IDD_RESTART DIALOG 6, 18, 245, 116
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION
-CAPTION "ReactOS Installation"
-FONT 8, "MS Shell Dlg"
-BEGIN
-    LTEXT "Installation of ReactOS was successfully completed.", IDC_STATIC, 13, 12, 212, 16
-    LTEXT "In order to continue, the installation program needs to restart your computer. "\
-          "The computer will be automatically restarted in 15 seconds or if you press the "\
-          "Restart button.", IDC_STATIC, 13, 33, 212, 32
-/*    GROUPBOX "", -1, 7, 3, 231, 106 */
-    CONTROL "", IDC_RESTART_PROGRESS, "msctls_progress32", PBS_SMOOTH | WS_CHILD | WS_VISIBLE | WS_BORDER, 13, 70, 212, 8 
-    PUSHBUTTON "&Restart", IDOK, 98, 87, 50, 14
-END
-
-
 IDD_GPL DIALOG 0, 0, 333, 230
 STYLE DS_CENTER | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "GNU General Public License"

Modified: trunk/reactos/lib/syssetup/syssetup_Fr.rc
--- trunk/reactos/lib/syssetup/syssetup_Fr.rc	2005-10-27 22:16:52 UTC (rev 18812)
+++ trunk/reactos/lib/syssetup/syssetup_Fr.rc	2005-10-27 22:33:17 UTC (rev 18813)
@@ -147,26 +147,12 @@
     LTEXT "L'assistant d'installation de ReactOS est terminÚ.",IDC_FINISHTITLE,115,9,195,37
     LTEXT "Vous avez installÚ avec succÞs ReactOS.\n\n" \
           "En cliquant sur Terminer, votre ordinateur va redÚmarrer.", IDC_STATIC, 115, 58, 195, 100
+    CONTROL "", IDC_RESTART_PROGRESS, "msctls_progress32", PBS_SMOOTH | WS_CHILD | WS_VISIBLE | WS_BORDER, 115, 138, 188, 12
     LTEXT "S'il y a un CD dans un lecteur, enlevez-le. Puis, pour redÚmarrer "\
           "votre ordinateur, cliquez sur Terminer.", IDC_STATIC, 115, 160, 195, 31
 END
 
 
-IDD_RESTART DIALOG 6, 18, 245, 116
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION
-CAPTION "Installation de ReactOS"
-FONT 8, "MS Shell Dlg"
-BEGIN
-   LTEXT "L'assistant d'installation de ReactOS est terminÚ.", IDC_STATIC, 13, 12, 212, 16
-   LTEXT "Pour continuer, l'assistant a besoin de redÚmarrer votre ordinateur. "\
-         "L'ordinateur redÚmarrera automatiquement dans 15 secondes, ou quand vous appuyerez "\
-         "sur le bouton RedÚmarrer.", IDC_STATIC, 13, 33, 212, 32
-/*   GROUPBOX "", -1, 7, 3, 231, 106 */
-   CONTROL "", IDC_RESTART_PROGRESS, "msctls_progress32", PBS_SMOOTH | WS_CHILD | WS_VISIBLE | WS_BORDER, 13, 70, 212, 8 
-   PUSHBUTTON "&RedÚmarrer", IDOK, 98, 87, 50, 14
-END
-
-
 IDD_GPL DIALOG 0, 0, 333, 230
 STYLE DS_CENTER | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "GNU General Public License"

Modified: trunk/reactos/lib/syssetup/syssetup_Ja.rc
--- trunk/reactos/lib/syssetup/syssetup_Ja.rc	2005-10-27 22:16:52 UTC (rev 18812)
+++ trunk/reactos/lib/syssetup/syssetup_Ja.rc	2005-10-27 22:33:17 UTC (rev 18813)
@@ -147,26 +147,12 @@
     LTEXT "ReactOS âZâbâgâAâbâv âEâBâUü[âhé¬è«ù?éÁé?éÁé¢", IDC_FINISHTITLE, 115, 8, 195, 24
     LTEXT "ReactOS âZâbâgâAâbâvé¬É?ÅÝé?è«ù?éÁé?éÁé¢üB\n\n" \
           "[è«ù?] é­âNâèâbâNéÀéÚéãüAâRâôâsâàü[â^é­ì?ïNô«éÁé?éÀüB", IDC_STATIC, 115, 40, 195, 100
+    CONTROL "", IDC_RESTART_PROGRESS, "msctls_progress32", PBS_SMOOTH | WS_CHILD | WS_VISIBLE | WS_BORDER, 115, 138, 188, 12
     LTEXT "âhâëâCâué? CD é¬ô³é?é?éóéÚÅÛìçé?üACD é­ÄµéÞÅoéÁé?é¡é¥é?éóüBCD é­ÄµéÞÅoéÁ"\
           "é¢éþüA[è«ù?] é­âNâèâbâNéÁé?âRâôâsâàü[â^é­ì?ïNô«éÁé?é¡é¥é?éóüB", IDC_STATIC, 115, 169, 195, 17
 END
 
 
-IDD_RESTART DIALOG 6, 18, 245, 116
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION
-CAPTION "ReactOS é?âCâôâXâgü[âï"
-FONT 9, "MS UI Gothic"
-BEGIN
-    LTEXT "ReactOS é?É?ÅÝé?âCâôâXâgü[âïé?éÛé?éÁé¢üB", IDC_STATIC, 13, 12, 212, 16
-    LTEXT "âCâôâXâgü[âï âvâìâOâëâÇé­æ?é»éÚé?é?üAâRâôâsâàü[â^é­ì?ïNô«éÀéÚòKùvé¬éáéÞé?éÀüB"\
-          "âRâôâsâàü[â^é? 15 òbîÒé?Ä®ô«ôIé?ì?ïNô«éÁé?éÀüBìíéÀé«ì?ïNô«éÀéÚé?é?"\
-          "[ì?ïNô«] â{â^âôé­âNâèâbâNéÁé?é¡é¥é?éóüB", IDC_STATIC, 13, 33, 212, 32
-/*    GROUPBOX "", -1, 7, 3, 231, 106 */
-    CONTROL "", IDC_RESTART_PROGRESS, "msctls_progress32", PBS_SMOOTH | WS_CHILD | WS_VISIBLE | WS_BORDER, 13, 70, 212, 8 
-    PUSHBUTTON "ì?ïNô«(&R)", IDOK, 98, 87, 50, 14
-END
-
-
 IDD_GPL DIALOG 0, 0, 333, 230
 STYLE DS_CENTER | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "GNU General Public License"

Modified: trunk/reactos/lib/syssetup/syssetup_Nl.rc
--- trunk/reactos/lib/syssetup/syssetup_Nl.rc	2005-10-27 22:16:52 UTC (rev 18812)
+++ trunk/reactos/lib/syssetup/syssetup_Nl.rc	2005-10-27 22:33:17 UTC (rev 18813)
@@ -147,26 +147,12 @@
     LTEXT "Completing the ReactOS Setup Wizard", IDC_FINISHTITLE, 115, 8, 195, 24
     LTEXT "You have successfully completed ReactOS Setup.\n\n" \
           "When you click Finish, your computer will restart.", IDC_STATIC, 115, 40, 195, 100
+    CONTROL "", IDC_RESTART_PROGRESS, "msctls_progress32", PBS_SMOOTH | WS_CHILD | WS_VISIBLE | WS_BORDER, 115, 138, 188, 12
     LTEXT "If there is a CD in a drive, remove it. Then, to restart "\
           "your computer, click Finish.", IDC_STATIC, 115, 169, 195, 17
 END
 
 
-IDD_RESTART DIALOG 6, 18, 245, 116
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION
-CAPTION "ReactOS Installation"
-FONT 8, "MS Shell Dlg"
-BEGIN
-    LTEXT "Installation of ReactOS was successfully completed.", IDC_STATIC, 13, 12, 212, 16
-    LTEXT "In order to continue, the installation program needs to restart your computer. "\
-          "The computer will be automatically restarted in 15 seconds or if you press the "\
-          "Restart button.", IDC_STATIC, 13, 33, 212, 32
-/*    GROUPBOX "", -1, 7, 3, 231, 106 */
-    CONTROL "", IDC_RESTART_PROGRESS, "msctls_progress32", PBS_SMOOTH | WS_CHILD | WS_VISIBLE | WS_BORDER, 13, 70, 212, 8 
-    PUSHBUTTON "&Restart", IDOK, 98, 87, 50, 14
-END
-
-
 IDD_GPL DIALOG 0, 0, 333, 230
 STYLE DS_CENTER | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "GNU General Public License"

Modified: trunk/reactos/lib/syssetup/wizard.c
--- trunk/reactos/lib/syssetup/wizard.c	2005-10-27 22:16:52 UTC (rev 18812)
+++ trunk/reactos/lib/syssetup/wizard.c	2005-10-27 22:33:17 UTC (rev 18813)
@@ -38,6 +38,7 @@
 #include "globals.h"
 #include "resource.h"
 
+#define VMWINST
 
 /* GLOBALS ******************************************************************/
 
@@ -46,6 +47,47 @@
 
 /* FUNCTIONS ****************************************************************/
 
+#ifdef VMWINST
+static BOOL
+RunVMWInstall(HWND hWnd)
+{
+  PROCESS_INFORMATION ProcInfo;
+  MSG msg;
+  DWORD ret;
+  STARTUPINFO si = {0};
+  WCHAR InstallName[] = L"vmwinst.exe";
+
+  si.cb = sizeof(STARTUPINFO);
+
+  if(CreateProcess(NULL, InstallName, NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS,
+                   NULL, NULL, &si, &ProcInfo))
+  {
+    EnableWindow(hWnd, FALSE);
+    for (;;)
+    {
+      while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
+      {
+        if (msg.message == WM_QUIT)
+          goto done;
+        TranslateMessage(&msg);
+        DispatchMessage(&msg);
+      }
+
+      ret = MsgWaitForMultipleObjects(1, &ProcInfo.hProcess, FALSE, INFINITE, QS_ALLEVENTS | QS_ALLINPUT);
+      if (ret == WAIT_OBJECT_0)
+        break;
+    }
+done:
+    EnableWindow(hWnd, TRUE);
+
+    CloseHandle(ProcInfo.hThread);
+    CloseHandle(ProcInfo.hProcess);
+    return TRUE;
+  }
+  return FALSE;
+}
+#endif
+
 static VOID
 CenterWindow(HWND hWnd)
 {
@@ -96,7 +138,7 @@
 }
 
 
-INT_PTR CALLBACK
+static INT_PTR CALLBACK
 GplDlgProc(HWND hwndDlg,
            UINT uMsg,
            WPARAM wParam,
@@ -165,7 +207,7 @@
 }
 
 
-INT_PTR CALLBACK
+static INT_PTR CALLBACK
 WelcomeDlgProc(HWND hwndDlg,
                UINT uMsg,
                WPARAM wParam,
@@ -231,7 +273,7 @@
 }
 
 
-INT_PTR CALLBACK
+static INT_PTR CALLBACK
 AckPageDlgProc(HWND hwndDlg,
                  UINT uMsg,
                  WPARAM wParam,
@@ -323,7 +365,7 @@
 }
 
 
-INT_PTR CALLBACK
+static INT_PTR CALLBACK
 OwnerPageDlgProc(HWND hwndDlg,
                  UINT uMsg,
                  WPARAM wParam,
@@ -413,7 +455,7 @@
 }
 
 
-INT_PTR CALLBACK
+static INT_PTR CALLBACK
 ComputerPageDlgProc(HWND hwndDlg,
                     UINT uMsg,
                     WPARAM wParam,
@@ -576,8 +618,8 @@
 static VOID
 RunInputLocalePage(HWND hwnd)
 {
-  PROPSHEETPAGE psp;
-  PROPSHEETHEADER psh;
+  PROPSHEETPAGE psp = {0};
+  PROPSHEETHEADER psh = {0};
   HMODULE hDll;
 //  TCHAR Caption[256];
 
@@ -585,7 +627,6 @@
   if (hDll == NULL)
     return;
 
-  ZeroMemory(&psp, sizeof(PROPSHEETPAGE));
   psp.dwSize = sizeof(PROPSHEETPAGE);
   psp.dwFlags = PSP_DEFAULT;
   psp.hInstance = hDll;
@@ -594,7 +635,6 @@
 
 //  LoadString(hDll, IDS_CPLNAME, Caption, sizeof(Caption) / sizeof(TCHAR));
 
-  ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
   psh.dwSize = sizeof(PROPSHEETHEADER);
   psh.dwFlags =  PSH_PROPSHEETPAGE | PSH_PROPTITLE;
 //  psh.hwndParent = hwnd;
@@ -611,7 +651,7 @@
 }
 
 
-INT_PTR CALLBACK
+static INT_PTR CALLBACK
 LocalePageDlgProc(HWND hwndDlg,
                   UINT uMsg,
                   WPARAM wParam,
@@ -1178,7 +1218,7 @@
 }
 
 
-INT_PTR CALLBACK
+static INT_PTR CALLBACK
 DateTimePageDlgProc(HWND hwndDlg,
                     UINT uMsg,
                     WPARAM wParam,
@@ -1252,7 +1292,7 @@
 }
 
 
-INT_PTR CALLBACK
+static INT_PTR CALLBACK
 ProcessPageDlgProc(HWND hwndDlg,
                    UINT uMsg,
                    WPARAM wParam,
@@ -1280,12 +1320,24 @@
 
            hWndProgress = GetDlgItem(hwndDlg, IDC_PROCESSPROGRESS);
            Position = SendMessage(hWndProgress, PBM_GETPOS, 0, 0);
-           if (Position == 300)
+           if (Position == 2)
            {
+             KillTimer(hwndDlg, 1);
+
+             /* Enable the Back and Next buttons */
+             PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_NEXT);
              PropSheet_PressButton(GetParent(hwndDlg), PSBTN_NEXT);
            }
            else
            {
+#ifdef VMWINST
+             if (Position == 1)
+             {
+                KillTimer(hwndDlg, 1);
+                RunVMWInstall(GetParent(hwndDlg));
+                SetTimer(hwndDlg, 1, 50, NULL);
+             }
+#endif
              SendMessage(hWndProgress, PBM_SETPOS, Position + 1, 0);
            }
          }
@@ -1302,14 +1354,11 @@
                 PropSheet_SetWizButtons(GetParent(hwndDlg), 0);
 
                 SendDlgItemMessage(hwndDlg, IDC_PROCESSPROGRESS, PBM_SETRANGE, 0,
-                                   MAKELPARAM(0, 300));
+                                   MAKELPARAM(0, 2));
                 SetTimer(hwndDlg, 1, 50, NULL);
                 break;
 
               case PSN_WIZNEXT:
-
-                /* Enable the Back and Next buttons */
-                PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_BACK | PSWIZB_NEXT);
                 break;
 
               default:
@@ -1327,7 +1376,7 @@
 
 
 
-INT_PTR CALLBACK
+static INT_PTR CALLBACK
 FinishDlgProc(HWND hwndDlg,
               UINT uMsg,
               WPARAM wParam,
@@ -1352,6 +1401,25 @@
         }
         break;
 
+      case WM_TIMER:
+         {
+           INT Position;
+           HWND hWndProgress;
+
+           hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
+           Position = SendMessage(hWndProgress, PBM_GETPOS, 0, 0);
+           if (Position == 300)
+           {
+             KillTimer(hwndDlg, 1);
+             PropSheet_PressButton(GetParent(hwndDlg), PSBTN_FINISH);
+           }
+           else
+           {
+             SendMessage(hWndProgress, PBM_SETPOS, Position + 1, 0);
+           }
+         }
+         return TRUE;
+
       case WM_NOTIFY:
         {
           LPNMHDR lpnm = (LPNMHDR)lParam;
@@ -1361,12 +1429,22 @@
               case PSN_SETACTIVE:
                 /* Enable the correct buttons on for the active page */
                 PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_BACK | PSWIZB_FINISH);
+                
+                SendDlgItemMessage(hwndDlg, IDC_RESTART_PROGRESS, PBM_SETRANGE, 0,
+                                   MAKELPARAM(0, 300));
+                SendDlgItemMessage(hwndDlg, IDC_RESTART_PROGRESS, PBM_SETPOS, 0, 0);
+                SetTimer(hwndDlg, 1, 50, NULL);
                 break;
 
               case PSN_WIZBACK:
                 /* Handle a Back button click, if necessary */
-                break;
+                KillTimer(hwndDlg, 1);
 
+                /* Skip the progress page */
+                PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_DATETIMEPAGE);
+                SetWindowLong(hwndDlg, DWL_MSGRESULT, -1);
+                return TRUE;
+
               case PSN_WIZFINISH:
                 /* Handle a Finish button click, if necessary */
                 break;
@@ -1390,20 +1468,20 @@
 {
   PROPSHEETHEADER psh;
   HPROPSHEETPAGE ahpsp[8];
-  PROPSHEETPAGE psp;
+  PROPSHEETPAGE psp = {0};
+  UINT nPages = 0;
 
   /* Clear setup data */
   ZeroMemory(&SetupData, sizeof(SETUPDATA));
 
   /* Create the Welcome page */
-  ZeroMemory (&psp, sizeof(PROPSHEETPAGE));
   psp.dwSize = sizeof(PROPSHEETPAGE);
   psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
   psp.hInstance = hDllInstance;
   psp.lParam = (LPARAM)&SetupData;
   psp.pfnDlgProc = WelcomeDlgProc;
   psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE);
-  ahpsp[0] = CreatePropertySheetPage(&psp);
+  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
 
   /* Create the Acknowledgements page */
   psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
@@ -1411,7 +1489,7 @@
   psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_ACKSUBTITLE);
   psp.pszTemplate = MAKEINTRESOURCE(IDD_ACKPAGE);
   psp.pfnDlgProc = AckPageDlgProc;
-  ahpsp[1] = CreatePropertySheetPage(&psp);
+  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
 
   /* Create the Owner page */
   psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
@@ -1419,7 +1497,7 @@
   psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_OWNERSUBTITLE);
   psp.pszTemplate = MAKEINTRESOURCE(IDD_OWNERPAGE);
   psp.pfnDlgProc = OwnerPageDlgProc;
-  ahpsp[2] = CreatePropertySheetPage(&psp);
+  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
 
   /* Create the Computer page */
   psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
@@ -1427,7 +1505,7 @@
   psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_COMPUTERSUBTITLE);
   psp.pfnDlgProc = ComputerPageDlgProc;
   psp.pszTemplate = MAKEINTRESOURCE(IDD_COMPUTERPAGE);
-  ahpsp[3] = CreatePropertySheetPage(&psp);
+  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
 
 
   /* Create the Locale page */
@@ -1436,7 +1514,7 @@
   psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_LOCALESUBTITLE);
   psp.pfnDlgProc = LocalePageDlgProc;
   psp.pszTemplate = MAKEINTRESOURCE(IDD_LOCALEPAGE);
-  ahpsp[4] = CreatePropertySheetPage(&psp);
+  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
 
 
   /* Create the DateTime page */
@@ -1445,32 +1523,30 @@
   psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_DATETIMESUBTITLE);
   psp.pfnDlgProc = DateTimePageDlgProc;
   psp.pszTemplate = MAKEINTRESOURCE(IDD_DATETIMEPAGE);
-  ahpsp[5] = CreatePropertySheetPage(&psp);
+  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
 
 
   /* Create the Process page */
-#if 0
   psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
   psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PROCESSTITLE);
   psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PROCESSSUBTITLE);
   psp.pfnDlgProc = ProcessPageDlgProc;
   psp.pszTemplate = MAKEINTRESOURCE(IDD_PROCESSPAGE);
-  ahpsp[6] = CreatePropertySheetPage(&psp);
-#endif
+  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
 
 
   /* Create the Finish page */
   psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
   psp.pfnDlgProc = FinishDlgProc;
   psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE);
-  ahpsp[6] = CreatePropertySheetPage(&psp);
+  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
 
   /* Create the property sheet */
   psh.dwSize = sizeof(PROPSHEETHEADER);
   psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER;
   psh.hInstance = hDllInstance;
   psh.hwndParent = NULL;
-  psh.nPages = 7;
+  psh.nPages = nPages;
   psh.nStartPage = 0;
   psh.phpage = ahpsp;
   psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);