- Do only allow to install reactos on disks which are visible by the bios.
[reactos.git] / reactos / subsys / system / usetup / usetup.c
index b52cc83..e930201 100644 (file)
  *                  Casper S. Hornstrup (chorns@users.sourceforge.net)
  */
 
-#include <ddk/ntddk.h>
-#include <ntdll/rtl.h>
-
-#include <ntos/minmax.h>
-#include <reactos/resource.h>
-
-#include "usetup.h"
-#include "console.h"
-#include "partlist.h"
-#include "inicache.h"
-#include "infcache.h"
-#include "filequeue.h"
-#include "progress.h"
-#include "bootsup.h"
-#include "registry.h"
-#include "format.h"
-#include "fslist.h"
-#include "cabinet.h"
-#include "filesup.h"
-#include "drivesup.h"
-#include "genlist.h"
-#include "settings.h"
+#include <usetup.h>
 
 #define NDEBUG
 #include <debug.h>
 
-
 typedef enum _PAGE_NUMBER
 {
   START_PAGE,
   INTRO_PAGE,
+  LICENSE_PAGE,
+  WARNING_PAGE,
   INSTALL_INTRO_PAGE,
 
 //  SCSI_CONTROLLER_PAGE,
@@ -65,7 +45,6 @@ typedef enum _PAGE_NUMBER
   DISPLAY_SETTINGS_PAGE,
   KEYBOARD_SETTINGS_PAGE,
   LAYOUT_SETTINGS_PAGE,
-  POINTER_SETTINGS_PAGE,
 
   SELECT_PARTITION_PAGE,
   CREATE_PARTITION_PAGE,
@@ -85,8 +64,6 @@ typedef enum _PAGE_NUMBER
 
   REPAIR_INTRO_PAGE,
 
-  EMERGENCY_INTRO_PAGE,
-
   SUCCESS_PAGE,
   QUIT_PAGE,
   FLUSH_PAGE,
@@ -139,7 +116,6 @@ static PGENERIC_LIST ComputerList = NULL;
 static PGENERIC_LIST DisplayList = NULL;
 static PGENERIC_LIST KeyboardList = NULL;
 static PGENERIC_LIST LayoutList = NULL;
-static PGENERIC_LIST PointerList = NULL;
 
 
 /* FUNCTIONS ****************************************************************/
@@ -368,7 +344,7 @@ PopupError(PCHAR Text,
       coPos.Y++;
       coPos.X = xLeft + 2;
       WriteConsoleOutputCharacters(Status,
-                                  min(strlen(Status), Width - 4),
+                                  min(strlen(Status), (SIZE_T)Width - 4),
                                   coPos);
     }
 }
@@ -534,7 +510,7 @@ CheckUnattendedSetup(VOID)
  *     Number of the next page.
  */
 static PAGE_NUMBER
-StartPage(PINPUT_RECORD Ir)
+SetupStartPage(PINPUT_RECORD Ir)
 {
   SYSTEM_DEVICE_INFORMATION Sdi;
   NTSTATUS Status;
@@ -707,11 +683,11 @@ IntroPage(PINPUT_RECORD Ir)
   SetTextXY(6, 12, "computer and prepares the second part of the setup.");
 
   SetTextXY(8, 15, "\x07  Press ENTER to install ReactOS.");
-  SetTextXY(8, 17, "\x07  Press E to start the emergency console.");
-  SetTextXY(8, 19, "\x07  Press R to repair ReactOS.");
+  SetTextXY(8, 17, "\x07  Press R to repair ReactOS.");
+  SetTextXY(8, 19, "\x07  Press L to view the ReactOS Licensing Terms and Conditions");
   SetTextXY(8, 21, "\x07  Press F3 to quit without installing ReactOS.");
 
-  SetStatusText("   ENTER = Continue   F3 = Quit");
+  SetStatusText("   ENTER = Continue  R = Repair F3 = Quit");
 
   if (IsUnattendedSetup)
     {
@@ -731,55 +707,105 @@ IntroPage(PINPUT_RECORD Ir)
        }
       else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
        {
-         return INSTALL_INTRO_PAGE;
-       }
-      else if (toupper(Ir->Event.KeyEvent.uChar.AsciiChar) == 'E') /* E */
-       {
-         return EMERGENCY_INTRO_PAGE;
+         return WARNING_PAGE;
+      break;
        }
       else if (toupper(Ir->Event.KeyEvent.uChar.AsciiChar) == 'R') /* R */
        {
          return REPAIR_INTRO_PAGE;
+      break;
        }
+      else if (toupper(Ir->Event.KeyEvent.uChar.AsciiChar) == 'L') /* R */
+       {
+         return LICENSE_PAGE;
+      break;
+       }   
     }
 
   return INTRO_PAGE;
 }
 
-
+/*
+ * License Page
+ * RETURNS
+ *     Back to main setup page.
+ */
 static PAGE_NUMBER
-EmergencyIntroPage(PINPUT_RECORD Ir)
+LicensePage(PINPUT_RECORD Ir)
 {
-  SetTextXY(6, 8, "ReactOS Setup is in an early development phase. It does not yet");
-  SetTextXY(6, 9, "support all the functions of a fully usable setup application.");
+  SetHighlightedTextXY(6, 8, "Licensing:");
 
-  SetTextXY(6, 12, "The emergency console is not implemented yet.");
+  SetTextXY(8, 11, "The ReactOS System is licensed under the terms of the");
+  SetTextXY(8, 12, "GNU GPL with parts containing code from other compatible");
+  SetTextXY(8, 13, "licenses such as the X11 or BSD and GNU LGPL licenses.");
+  SetTextXY(8, 14, "All software that is part of the ReactOS system is");
+  SetTextXY(8, 15, "therefore released under the GNU GPL as well as maintaining");
+  SetTextXY(8, 16, "the original license.");
 
-  SetTextXY(8, 15, "\x07  Press ESC to return to the main page.");
+  SetTextXY(8, 18, "This software comes with NO WARRANTY or restrictions on usage");
+  SetTextXY(8, 19, "save applicable local and international law. The licensing of");
+  SetTextXY(8, 20, "ReactOS only covers distribution to third parties.");
 
-  SetTextXY(8, 17, "\x07  Press ENTER to reboot your computer.");
+  SetTextXY(8, 22, "If for some reason you did not receive a copy of the");
+  SetTextXY(8, 23, "GNU General Public License with ReactOS please visit");
+  SetHighlightedTextXY(8, 25, "http://www.gnu.org/licenses/licenses.html");
 
-  SetStatusText("   ESC = Main page  ENTER = Reboot");
+  SetStatusText("   ENTER = Return");
 
-  while(TRUE)
+  while (TRUE)
     {
       ConInKey(Ir);
 
       if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
+      {
+          return INTRO_PAGE;
+          break;
+      }
+    }
+
+  return LICENSE_PAGE;
+}
+
+/*
+ * Warning Page
+ * RETURNS
+ *     Continues to setup
+ */
+static PAGE_NUMBER
+WarningPage(PINPUT_RECORD Ir)
+{
+  SetUnderlinedTextXY(4, 3, " ReactOS " KERNEL_VERSION_STR " Warranty Statement");
+  SetHighlightedTextXY(6, 8, "Warranty:");
+
+  SetTextXY(8, 11, "This is free software; see the source for copying conditions.");
+  SetTextXY(8, 12, "There is NO warranty; not even for MERCHANTABILITY or");
+  SetTextXY(8, 13, "FITNESS FOR A PARTICULAR PURPOSE");
+
+  SetTextXY(8, 15, "For more information on ReactOS, please visit:");
+  SetHighlightedTextXY(8, 16, "http://www.reactos.org");
+
+  SetStatusText("   F8 = Continue   ESC = Exit");
+
+  while (TRUE)
+    {
+      ConInKey(Ir);
+
+      if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
+         (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F8)) /* F8 */
        {
-         return REBOOT_PAGE;
+           return INSTALL_INTRO_PAGE;
+         break;
        }
       else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
               (Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE)) /* ESC */
        {
-         return INTRO_PAGE;
+         return QUIT_PAGE;
        }
     }
 
-  return REPAIR_INTRO_PAGE;
+  return LICENSE_PAGE;
 }
 
-
 static PAGE_NUMBER
 RepairIntroPage(PINPUT_RECORD Ir)
 {
@@ -788,9 +814,11 @@ RepairIntroPage(PINPUT_RECORD Ir)
 
   SetTextXY(6, 12, "The repair functions are not implemented yet.");
 
-  SetTextXY(8, 15, "\x07  Press ESC to return to the main page.");
+  SetTextXY(8, 15, "\x07  Press R for the Recovery Console.");
+  
+  SetTextXY(8, 17, "\x07  Press ESC to return to the main page.");
 
-  SetTextXY(8, 17, "\x07  Press ENTER to reboot your computer.");
+  SetTextXY(8, 19, "\x07  Press ENTER to reboot your computer.");
 
   SetStatusText("   ESC = Main page  ENTER = Reboot");
 
@@ -802,6 +830,10 @@ RepairIntroPage(PINPUT_RECORD Ir)
        {
          return REBOOT_PAGE;
        }
+    else if (toupper(Ir->Event.KeyEvent.uChar.AsciiChar) == 'R') /* R */
+       {
+         return INTRO_PAGE;
+       }
       else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
               (Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE)) /* ESC */
        {
@@ -816,6 +848,8 @@ RepairIntroPage(PINPUT_RECORD Ir)
 static PAGE_NUMBER
 InstallIntroPage(PINPUT_RECORD Ir)
 {
+  SetUnderlinedTextXY(4, 3, " ReactOS " KERNEL_VERSION_STR " Setup ");
+
   SetTextXY(6, 8, "ReactOS Setup is in an early development phase. It does not yet");
   SetTextXY(6, 9, "support all the functions of a fully usable setup application.");
 
@@ -902,7 +936,7 @@ ScsiControllerPage(PINPUT_RECORD Ir)
 static PAGE_NUMBER
 DeviceSettingsPage(PINPUT_RECORD Ir)
 {
-  static ULONG Line = 17;
+  static ULONG Line = 16;
 
   /* Initialize the computer settings list */
   if (ComputerList == NULL)
@@ -956,42 +990,30 @@ DeviceSettingsPage(PINPUT_RECORD Ir)
        }
     }
 
-  /* Initialize the pointer settings list */
-  if (PointerList == NULL)
-    {
-      PointerList = CreateMouseDriverList(SetupInf);
-      if (PointerList == NULL)
-       {
-         /* FIXME: report error */
-       }
-    }
-
   SetTextXY(6, 8, "The list below shows the current device settings.");
 
   SetTextXY(8, 11, "       Computer:");
   SetTextXY(8, 12, "        Display:");
   SetTextXY(8, 13, "       Keyboard:");
   SetTextXY(8, 14, "Keyboard layout:");
-  SetTextXY(8, 15, " Pointer device:");
 
-  SetTextXY(8, 17, "         Accept:");
+  SetTextXY(8, 16, "         Accept:");
 
   SetTextXY(25, 11, GetGenericListEntry(ComputerList)->Text);
   SetTextXY(25, 12, GetGenericListEntry(DisplayList)->Text);
   SetTextXY(25, 13, GetGenericListEntry(KeyboardList)->Text);
   SetTextXY(25, 14, GetGenericListEntry(LayoutList)->Text);
-  SetTextXY(25, 15, GetGenericListEntry(PointerList)->Text);
 
-  SetTextXY(25, 17, "Accept these device settings");
+  SetTextXY(25, 16, "Accept these device settings");
   InvertTextXY (24, Line, 48, 1);
 
 
-  SetTextXY(6, 20, "You can change the hardware settings by pressing the UP or DOWN keys");
-  SetTextXY(6, 21, "to select an entry. Then press the ENTER key to select alternative");
-  SetTextXY(6, 22, "settings.");
+  SetTextXY(6, 19, "You can change the hardware settings by pressing the UP or DOWN keys");
+  SetTextXY(6, 20, "to select an entry. Then press the ENTER key to select alternative");
+  SetTextXY(6, 21, "settings.");
 
-  SetTextXY(6, 24, "When all settings are correct, select \"Accept these device settings\"");
-  SetTextXY(6, 25, "and press ENTER.");
+  SetTextXY(6, 23, "When all settings are correct, select \"Accept these device settings\"");
+  SetTextXY(6, 24, "and press ENTER.");
 
   SetStatusText("   ENTER = Continue   F3 = Quit");
 
@@ -1003,9 +1025,9 @@ DeviceSettingsPage(PINPUT_RECORD Ir)
          (Ir->Event.KeyEvent.wVirtualKeyCode == VK_DOWN)) /* DOWN */
        {
          NormalTextXY (24, Line, 48, 1);
-         if (Line == 15)
-           Line = 17;
-         else if (Line == 17)
+         if (Line == 14)
+           Line = 16;
+         else if (Line == 16)
            Line = 11;
          else
            Line++;
@@ -1016,9 +1038,9 @@ DeviceSettingsPage(PINPUT_RECORD Ir)
        {
          NormalTextXY (24, Line, 48, 1);
          if (Line == 11)
-           Line = 17;
-         else if (Line == 17)
-           Line = 15;
+           Line = 16;
+         else if (Line == 16)
+           Line = 14;
          else
            Line--;
          InvertTextXY (24, Line, 48, 1);
@@ -1040,9 +1062,7 @@ DeviceSettingsPage(PINPUT_RECORD Ir)
            return KEYBOARD_SETTINGS_PAGE;
          else if (Line == 14)
            return LAYOUT_SETTINGS_PAGE;
-         else if (Line == 15)
-           return POINTER_SETTINGS_PAGE;
-         else if (Line == 17)
+         else if (Line == 16)
            return SELECT_PARTITION_PAGE;
        }
     }
@@ -1305,69 +1325,6 @@ LayoutSettingsPage(PINPUT_RECORD Ir)
 }
 
 
-static PAGE_NUMBER
-PointerSettingsPage(PINPUT_RECORD Ir)
-{
-  SHORT xScreen;
-  SHORT yScreen;
-
-  SetTextXY(6, 8, "You want to change the pointing device to be installed.");
-
-  SetTextXY(8, 10, "\x07  Press the UP or DOWN key to select the desired pointing");
-  SetTextXY(8, 11, "    device. Then press ENTER.");
-
-  SetTextXY(8, 13, "\x07  Press the ESC key to return to the previous page without changing");
-  SetTextXY(8, 14, "   the pointing device.");
-
-  GetScreenSize(&xScreen, &yScreen);
-
-  DrawGenericList(PointerList,
-                 2,
-                 18,
-                 xScreen - 3,
-                 yScreen - 3);
-
-  SetStatusText("   ENTER = Continue   ESC = Cancel   F3 = Quit");
-
-  SaveGenericListState(PointerList);
-
-  while(TRUE)
-    {
-      ConInKey(Ir);
-
-      if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
-         (Ir->Event.KeyEvent.wVirtualKeyCode == VK_DOWN)) /* DOWN */
-       {
-         ScrollDownGenericList(PointerList);
-       }
-      else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
-         (Ir->Event.KeyEvent.wVirtualKeyCode == VK_UP)) /* UP */
-       {
-         ScrollUpGenericList(PointerList);
-       }
-      else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
-              (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
-       {
-         if (ConfirmQuit(Ir) == TRUE)
-           return QUIT_PAGE;
-         break;
-       }
-      else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
-              (Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE)) /* ESC */
-       {
-         RestoreGenericListState(PointerList);
-         return DEVICE_SETTINGS_PAGE;
-       }
-      else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
-       {
-         return DEVICE_SETTINGS_PAGE;
-       }
-    }
-
-  return DISPLAY_SETTINGS_PAGE;
-}
-
-
 static PAGE_NUMBER
 SelectPartitionPage(PINPUT_RECORD Ir)
 {
@@ -1488,7 +1445,7 @@ SelectPartitionPage(PINPUT_RECORD Ir)
 
          return SELECT_FILE_SYSTEM_PAGE;
        }
-      else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_C) /* C */
+      else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'C') /* C */
        {
          if (PartitionList->CurrentPartition->Unpartitioned == FALSE)
            {
@@ -1504,7 +1461,7 @@ SelectPartitionPage(PINPUT_RECORD Ir)
 
          return CREATE_PARTITION_PAGE;
        }
-      else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_D) /* D */
+      else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'D') /* D */
        {
          if (PartitionList->CurrentPartition->Unpartitioned == TRUE)
            {
@@ -1656,8 +1613,8 @@ ShowPartitionSizeInputBox(SHORT Left,
                                strlen (Buffer),
                                coPos);
 
-  Buffer[0] = 0;
-  Index = 0;
+  sprintf(Buffer, "%lu", MaxSize);
+  Index = strlen(Buffer);
   DrawInputField (PARTITION_SIZE_INPUT_FIELD_LENGTH,
                  iLeft,
                  iTop,
@@ -1912,14 +1869,14 @@ DeletePartitionPage (PINPUT_RECORD Ir)
     }
 
 #if 0
-  if (PartEntry->PartInfo[0].PartitionLength.QuadPart >= 0x280000000ULL) /* 10 GB */
+  if (PartEntry->PartInfo[0].PartitionLength.QuadPart >= 0x280000000LL) /* 10 GB */
     {
       PartSize = (PartEntry->PartInfo[0].PartitionLength.QuadPart + (1 << 29)) >> 30;
       Unit = "GB";
     }
   else
 #endif
-  if (PartEntry->PartInfo[0].PartitionLength.QuadPart >= 0xA00000ULL) /* 10 MB */
+  if (PartEntry->PartInfo[0].PartitionLength.QuadPart >= 0xA00000LL) /* 10 MB */
     {
       PartSize = (PartEntry->PartInfo[0].PartitionLength.QuadPart + (1 << 19)) >> 20;
       Unit = "MB";
@@ -2014,7 +1971,7 @@ DeletePartitionPage (PINPUT_RECORD Ir)
        {
          return SELECT_PARTITION_PAGE;
        }
-      else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_D) /* D */
+      else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'D') /* D */
        {
          DeleteCurrentPartition (PartitionList);
 
@@ -2061,7 +2018,7 @@ SelectFileSystemPage (PINPUT_RECORD Ir)
     }
 
   /* adjust partition size */
-  if (PartEntry->PartInfo[0].PartitionLength.QuadPart >= 0x280000000ULL) /* 10 GB */
+  if (PartEntry->PartInfo[0].PartitionLength.QuadPart >= 0x280000000LL) /* 10 GB */
     {
       PartSize = (PartEntry->PartInfo[0].PartitionLength.QuadPart + (1 << 29)) >> 30;
       PartUnit = "GB";
@@ -2247,6 +2204,7 @@ FormatPartitionPage (PINPUT_RECORD Ir)
 #ifndef NDEBUG
   ULONG Line;
   ULONG i;
+  PLIST_ENTRY Entry;
 #endif
 
 
@@ -2290,21 +2248,21 @@ FormatPartitionPage (PINPUT_RECORD Ir)
              switch (FileSystemList->CurrentFileSystem)
                {
                  case FsFat:
-                   if (PartEntry->PartInfo[0].PartitionLength.QuadPart < (4200ULL * 1024ULL))
+                   if (PartEntry->PartInfo[0].PartitionLength.QuadPart < (4200LL * 1024LL))
                      {
                        /* FAT12 CHS partition (disk is smaller than 4.1MB) */
                        PartEntry->PartInfo[0].PartitionType = PARTITION_FAT_12;
                      }
-                   else if (PartEntry->PartInfo[0].StartingOffset.QuadPart < (1024ULL * 255ULL * 63ULL * 512ULL))
+                   else if (PartEntry->PartInfo[0].StartingOffset.QuadPart < (1024LL * 255LL * 63LL * 512LL))
                      {
                        /* Partition starts below the 8.4GB boundary ==> CHS partition */
 
-                       if (PartEntry->PartInfo[0].PartitionLength.QuadPart < (32ULL * 1024ULL * 1024ULL))
+                       if (PartEntry->PartInfo[0].PartitionLength.QuadPart < (32LL * 1024LL * 1024LL))
                          {
                            /* FAT16 CHS partition (partiton size < 32MB) */
                            PartEntry->PartInfo[0].PartitionType = PARTITION_FAT_16;
                          }
-                       else if (PartEntry->PartInfo[0].PartitionLength.QuadPart < (512ULL * 1024ULL * 1024ULL))
+                       else if (PartEntry->PartInfo[0].PartitionLength.QuadPart < (512LL * 1024LL * 1024LL))
                          {
                            /* FAT16 CHS partition (partition size < 512MB) */
                            PartEntry->PartInfo[0].PartitionType = PARTITION_HUGE;
@@ -2319,7 +2277,7 @@ FormatPartitionPage (PINPUT_RECORD Ir)
                      {
                        /* Partition starts above the 8.4GB boundary ==> LBA partition */
 
-                       if (PartEntry->PartInfo[0].PartitionLength.QuadPart < (512ULL * 1024ULL * 1024ULL))
+                       if (PartEntry->PartInfo[0].PartitionLength.QuadPart < (512LL * 1024LL * 1024LL))
                          {
                            /* FAT16 LBA partition (partition size < 512MB) */
                            PartEntry->PartInfo[0].PartitionType = PARTITION_XINT13;
@@ -2587,7 +2545,7 @@ InstallDirectoryPage1(PWCHAR InstallDir, PDISKENTRY DiskEntry, PPARTENTRY PartEn
   RtlFreeUnicodeString(&DestinationArcPath);
   swprintf(PathBuffer,
           L"multi(0)disk(0)rdisk(%lu)partition(%lu)",
-          DiskEntry->DiskNumber,
+          DiskEntry->BiosDiskNumber,
           PartEntry->PartInfo[0].PartitionNumber);
   if (InstallDir[0] != L'\\')
     wcscat(PathBuffer,
@@ -2707,27 +2665,24 @@ InstallDirectoryPage(PINPUT_RECORD Ir)
 
 
 static BOOLEAN
-PrepareCopyPageInfFile(HINF InfFile,
+AddSectionToCopyQueue(HINF InfFile,
+                      PWCHAR SectionName,
                       PWCHAR SourceCabinet,
                       PINPUT_RECORD Ir)
 {
-  WCHAR PathBuffer[MAX_PATH];
   INFCONTEXT FilesContext;
   INFCONTEXT DirContext;
-  PWCHAR KeyValue;
-  ULONG Length;
-  NTSTATUS Status;
   PWCHAR FileKeyName;
   PWCHAR FileKeyValue;
   PWCHAR DirKeyValue;
   PWCHAR TargetFileName;
 
-  /* Search for the 'SourceFiles' section */
-  if (!InfFindFirstLine (InfFile, L"SourceFiles", NULL, &FilesContext))
+  /* Search for the SectionName section */
+  if (!InfFindFirstLine (InfFile, SectionName, NULL, &FilesContext))
     {
-      PopupError("Setup failed to find the 'SourceFiles' section\n"
-                "in TXTSETUP.SIF.\n",  // FIXME
-                "ENTER = Reboot computer");
+      char Buffer[128];
+      sprintf(Buffer, "Setup failed to find the '%S' section\nin TXTSETUP.SIF.\n", SectionName);
+      PopupError(Buffer, "ENTER = Reboot computer");
 
       while(TRUE)
        {
@@ -2741,7 +2696,7 @@ PrepareCopyPageInfFile(HINF InfFile,
     }
 
   /*
-   * Enumerate the files in the 'SourceFiles' section
+   * Enumerate the files in the section
    * and add them to the file queue.
    */
   do
@@ -2789,6 +2744,36 @@ PrepareCopyPageInfFile(HINF InfFile,
     }
   while (InfFindNextLine(&FilesContext, &FilesContext));
 
+  return TRUE;
+}
+
+static BOOLEAN
+PrepareCopyPageInfFile(HINF InfFile,
+                      PWCHAR SourceCabinet,
+                      PINPUT_RECORD Ir)
+{
+  WCHAR PathBuffer[MAX_PATH];
+  INFCONTEXT DirContext;
+  PWCHAR AdditionalSectionName;
+  PWCHAR KeyValue;
+  ULONG Length;
+  NTSTATUS Status;
+
+  /* Add common files */
+  if (!AddSectionToCopyQueue(InfFile, L"SourceFiles", SourceCabinet, Ir))
+    return FALSE;
+
+  /* Add specific files depending of computer type */
+  if (SourceCabinet == NULL)
+  {
+    if (!ProcessComputerFiles(InfFile, ComputerList, &AdditionalSectionName))
+      return FALSE;
+    if (AdditionalSectionName)
+    {
+      if (!AddSectionToCopyQueue(InfFile, AdditionalSectionName, SourceCabinet, Ir))
+        return FALSE;
+    }
+  }
 
   /* Create directories */
 
@@ -2808,7 +2793,7 @@ PrepareCopyPageInfFile(HINF InfFile,
     }
 
   /* Create the install directory */
-  Status = CreateDirectory(PathBuffer);
+  Status = SetupCreateDirectory(PathBuffer);
   if (!NT_SUCCESS(Status) && Status != STATUS_OBJECT_NAME_COLLISION)
     {
       DPRINT("Creating directory '%S' failed: Status = 0x%08lx", PathBuffer, Status);
@@ -2879,7 +2864,7 @@ PrepareCopyPageInfFile(HINF InfFile,
 
          DPRINT("FullPath: '%S'\n", PathBuffer);
 
-         Status = CreateDirectory(PathBuffer);
+         Status = SetupCreateDirectory(PathBuffer);
          if (!NT_SUCCESS(Status) && Status != STATUS_OBJECT_NAME_COLLISION)
            {
              DPRINT("Creating directory '%S' failed: Status = 0x%08lx", PathBuffer, Status);
@@ -3058,11 +3043,7 @@ FileCopyCallback(PVOID Context,
 
       case SPFILENOTIFY_STARTCOPY:
        /* Display copy message */
-       PrintTextXYN(6, 16, 60, "Copying file: %S", (PWSTR)Param1);
-
-       PrintTextXYN(6, 18, 60, "File %lu of %lu",
-                    CopyContext->CompletedOperations + 1,
-                    CopyContext->TotalOperations);
+    SetStatusText("                                                   \xB3 Copying file: %S", (PWSTR)Param1);
        break;
 
       case SPFILENOTIFY_ENDCOPY:
@@ -3082,18 +3063,20 @@ FileCopyPage(PINPUT_RECORD Ir)
   SHORT xScreen;
   SHORT yScreen;
 
-  SetStatusText("   Please wait...");
-
-  SetTextXY(6, 8, "Copying files");
+  SetStatusText("                                                           \xB3 Please wait...    ");
 
-  GetScreenSize(&xScreen, &yScreen);
+  SetTextXY(11, 12, "Please wait while ReactOS Setup copies files to your ReactOS");
+  SetTextXY(30, 13, "installation folder.");
+  SetTextXY(20, 14, "This may take several minutes to complete.");
 
+  GetScreenSize(&xScreen, &yScreen);  
   CopyContext.TotalOperations = 0;
   CopyContext.CompletedOperations = 0;
-  CopyContext.ProgressBar = CreateProgressBar(6,
-                                             yScreen - 14,
-                                             xScreen - 7,
-                                             yScreen - 10);
+  CopyContext.ProgressBar = CreateProgressBar(13,
+                                             26,
+                                             xScreen - 13,
+                                             yScreen - 20,
+                          "Setup is copying files...");
 
   SetupCommitFileQueue(SetupFileQueue,
                       DestinationRootPath.Buffer,
@@ -3258,23 +3241,8 @@ RegistryPage(PINPUT_RECORD Ir)
        }
     }
 
-  /* Update mouse registry settings */
-  SetStatusText("   Updating mouse registry settings...");
-  if (!ProcessMouseRegistry(SetupInf, PointerList))
-    {
-      PopupError("Setup failed to update mouse registry settings.",
-                "ENTER = Reboot computer");
-
-      while(TRUE)
-       {
-         ConInKey(Ir);
-
-         if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)       /* ENTER */
-           {
-             return QUIT_PAGE;
-           }
-       }
-    }
+  /* Update the mounted devices list */
+  SetMountedDeviceValues(PartitionList);
 
   SetStatusText("   Done...");
 
@@ -3574,13 +3542,6 @@ QuitPage(PINPUT_RECORD Ir)
       LayoutList = NULL;
     }
 
-  /* Destroy pointer device list */
-  if (PointerList != NULL)
-    {
-      DestroyGenericList(PointerList, TRUE);
-      PointerList = NULL;
-    }
-
   SetStatusText("   ENTER = Reboot computer");
 
   while(TRUE)
@@ -3638,6 +3599,42 @@ FlushPage(PINPUT_RECORD Ir)
 }
 
 
+static VOID
+SignalInitEvent()
+{
+  NTSTATUS Status;
+  OBJECT_ATTRIBUTES ObjectAttributes;
+  UNICODE_STRING UnicodeString = RTL_CONSTANT_STRING(L"\\ReactOSInitDone");
+  HANDLE ReactOSInitEvent;
+
+  InitializeObjectAttributes(&ObjectAttributes,
+    &UnicodeString,
+    0,
+    0,
+    NULL);
+  Status = NtOpenEvent(&ReactOSInitEvent,
+    EVENT_ALL_ACCESS,
+    &ObjectAttributes);
+  if (NT_SUCCESS(Status))
+    {
+      LARGE_INTEGER Timeout;
+      /* This will cause the boot screen image to go away (if displayed) */
+      NtPulseEvent(ReactOSInitEvent, NULL);
+
+      /* Wait for the display mode to be changed (if in graphics mode) */
+      Timeout.QuadPart = -50000000LL;  /* 5 second timeout */
+      NtWaitForSingleObject(ReactOSInitEvent, FALSE, &Timeout);
+
+      NtClose(ReactOSInitEvent);
+    }
+  else
+    {
+      /* We don't really care if this fails */
+      DPRINT1("USETUP: Failed to open ReactOS init notification event\n");
+    }
+}
+
+
 VOID STDCALL
 NtProcessStartup(PPEB Peb)
 {
@@ -3649,6 +3646,8 @@ NtProcessStartup(PPEB Peb)
 
   ProcessHeap = Peb->ProcessHeap;
 
+  SignalInitEvent();
+
   Status = AllocConsole();
   if (!NT_SUCCESS(Status))
     {
@@ -3683,7 +3682,17 @@ NtProcessStartup(PPEB Peb)
        {
          /* Start page */
          case START_PAGE:
-           Page = StartPage(&Ir);
+           Page = SetupStartPage(&Ir);
+           break;
+
+         /* License page */
+         case LICENSE_PAGE:
+           Page = LicensePage(&Ir);
+           break;
+        
+         /* Warning page */
+         case WARNING_PAGE:
+           Page = WarningPage(&Ir);
            break;
 
          /* Intro page */
@@ -3728,10 +3737,6 @@ NtProcessStartup(PPEB Peb)
            Page = LayoutSettingsPage(&Ir);
            break;
 
-         case POINTER_SETTINGS_PAGE:
-           Page = PointerSettingsPage(&Ir);
-           break;
-
          case SELECT_PARTITION_PAGE:
            Page = SelectPartitionPage(&Ir);
            break;
@@ -3790,13 +3795,6 @@ NtProcessStartup(PPEB Peb)
            Page = RepairIntroPage(&Ir);
            break;
 
-
-         /* Emergency pages */
-         case EMERGENCY_INTRO_PAGE:
-           Page = EmergencyIntroPage(&Ir);
-           break;
-
-
          case SUCCESS_PAGE:
            Page = SuccessPage(&Ir);
            break;
@@ -3817,6 +3815,7 @@ NtProcessStartup(PPEB Peb)
   /* Reboot */
   FreeConsole();
   NtShutdownSystem(ShutdownReboot);
+  NtTerminateProcess(NtCurrentProcess(), 0);
 }
 
 /* EOF */