3 * Copyright (C) 2002 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 * COPYRIGHT: See COPYING in the top level directory
21 * PROJECT: ReactOS text-mode setup
22 * FILE: subsys/system/usetup/usetup.c
23 * PURPOSE: Text-mode setup
24 * PROGRAMMER: Eric Kohl
27 #include <ddk/ntddk.h>
28 #include <ntdll/rtl.h>
38 #define INSTALL_INTRO_PAGE 2
40 #define SELECT_PARTITION_PAGE 4
41 #define SELECT_FILE_SYSTEM_PAGE 5
42 #define CHECK_FILE_SYSTEM_PAGE 6
43 #define PREPARE_COPY_PAGE 7
44 #define INSTALL_DIRECTORY_PAGE 8
45 #define FILE_COPY_PAGE 9
46 #define INIT_SYSTEM_PAGE 10
48 #define REPAIR_INTRO_PAGE 20
50 #define SUCCESS_PAGE 100
52 #define REBOOT_PAGE 102
55 /* GLOBALS ******************************************************************/
59 BOOL PartDataValid = FALSE;
64 UNICODE_STRING SourcePath;
65 UNICODE_STRING SourceRootPath;
68 /* FUNCTIONS ****************************************************************/
71 PrintString(char* fmt,...)
75 UNICODE_STRING UnicodeString;
76 ANSI_STRING AnsiString;
79 vsprintf(buffer, fmt, ap);
82 RtlInitAnsiString(&AnsiString, buffer);
83 RtlAnsiStringToUnicodeString(&UnicodeString,
86 NtDisplayString(&UnicodeString);
87 RtlFreeUnicodeString(&UnicodeString);
95 * FALSE: Don't quit setup.
98 ConfirmQuit(PINPUT_RECORD Ir)
105 PUSHORT pAttributes = NULL;
106 PUCHAR pCharacters = NULL;
109 GetScreenSize(&xScreen, &yScreen);
110 yTop = (yScreen - 10) / 2;
111 xLeft = (xScreen - 52) / 2;
117 pAttributes = (PUSHORT)RtlAllocateHeap(ProcessHeap,
119 xScreen * yScreen * sizeof(USHORT));
121 DPRINT1("pAttributes %p\n", pAttributes);
122 ReadConsoleOutputAttributes(pAttributes,
127 pCharacters = (PUCHAR)RtlAllocateHeap(ProcessHeap,
129 xScreen * yScreen * sizeof(UCHAR));
131 ReadConsoleOutputCharacters(pCharacters,
138 /* Draw popup window */
139 SetTextXY(xLeft, yTop,
140 "+----------------------------------------------------+");
141 SetTextXY(xLeft, yTop + 1,
142 "| ReactOS 0.0.20 is not completely installed on your |");
143 SetTextXY(xLeft, yTop + 2,
144 "| computer. If you quit Setup now, you will need to |");
145 SetTextXY(xLeft, yTop + 3,
146 "| run Setup again to install ReactOS. |");
147 SetTextXY(xLeft, yTop + 4,
149 SetTextXY(xLeft, yTop + 5,
150 "| * Press ENTER to continue Setup. |");
151 SetTextXY(xLeft, yTop + 6,
152 "| * Press F3 to quit Setup. |");
153 SetTextXY(xLeft, yTop + 7,
154 "+----------------------------------------------------+");
155 SetTextXY(xLeft, yTop + 8,
156 "| F3= Quit ENTER = Continue |");
157 SetTextXY(xLeft, yTop + 9,
158 "+----------------------------------------------------+");
164 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
165 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
170 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
180 WriteConsoleOutputAttributes(pAttributes,
186 WriteConsoleOutputCharacters(pCharacters,
191 RtlFreeHeap(ProcessHeap,
194 RtlFreeHeap(ProcessHeap,
208 * TRUE: setup/repair completed successfully
209 * FALSE: setup/repair terminated by user
212 StartPage(PINPUT_RECORD Ir)
216 SetStatusText(" Please wait...");
218 Status = GetSourcePaths(&SourcePath,
220 if (!NT_SUCCESS(Status))
222 PrintTextXY(6, 15, "GetSourcePath() failed (Status 0x%08lx)", Status);
226 PrintTextXY(6, 15, "SourcePath: '%wZ'", &SourcePath);
227 PrintTextXY(6, 16, "SourceRootPath: '%wZ'", &SourceRootPath);
231 * FIXME: Open and load txtsetup.sif here. A pointer (or handle) to the
232 * ini data should be stored in a global variable.
233 * The full path to txtsetup.sif is created by appending '\txtsetup.sif'
234 * to the unicode string SourceRootPath.
237 SetStatusText(" ENTER = Continue");
243 if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
255 RepairIntroPage(PINPUT_RECORD Ir)
257 SetTextXY(6, 8, "ReactOS Setup is in an early development phase. It does not yet");
258 SetTextXY(6, 9, "support all the functions of a fully usable setup application.");
260 SetTextXY(6, 12, "The repair functions are not implemented yet.");
262 SetTextXY(8, 15, "\xf9 Press ESC to return to the main page.");
264 SetTextXY(8, 17, "\xf9 Press ENTER to reboot your computer.");
266 SetStatusText(" ESC = Main page ENTER = Reboot");
272 if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
276 else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
277 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE)) /* ESC */
283 return(REPAIR_INTRO_PAGE);
290 * TRUE: setup/repair completed successfully
291 * FALSE: setup/repair terminated by user
294 IntroPage(PINPUT_RECORD Ir)
296 SetHighlightedTextXY(6, 8, "Welcome to ReactOS Setup");
298 SetTextXY(6, 11, "This part of the setup copies the ReactOS Operating System to your");
299 SetTextXY(6, 12, "computer and prepares the second part of the setup.");
301 SetTextXY(8, 15, "\xf9 Press ENTER to install ReactOS.");
303 SetTextXY(8, 17, "\xf9 Press R to repair ReactOS.");
305 SetTextXY(8, 19, "\xf9 Press F3 to quit without installing ReactOS.");
308 SetStatusText(" ENTER = Continue F3 = Quit");
314 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
315 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
317 if (ConfirmQuit(Ir) == TRUE)
321 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
323 return(INSTALL_INTRO_PAGE);
325 else if (toupper(Ir->Event.KeyEvent.uChar.AsciiChar) == 'R') /* R */
327 return(REPAIR_INTRO_PAGE);
336 InstallIntroPage(PINPUT_RECORD Ir)
338 SetTextXY(6, 8, "ReactOS Setup is in an early development phase. It does not yet");
339 SetTextXY(6, 9, "support all the functions of a fully usable setup application.");
341 SetTextXY(6, 12, "The following functions are missing:");
342 SetTextXY(8, 13, "- Creating and deleting harddisk partitions.");
343 SetTextXY(8, 14, "- Formatting partitions.");
344 SetTextXY(8, 15, "- Support for non-FAT file systems.");
345 SetTextXY(8, 16, "- Checking file systems.");
346 SetTextXY(8, 17, "- Installing the bootloader.");
350 SetTextXY(8, 21, "\xf9 Press ENTER to install ReactOS.");
352 SetTextXY(8, 23, "\xf9 Press F3 to quit without installing ReactOS.");
355 SetStatusText(" ENTER = Continue F3 = Quit");
361 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
362 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3))
364 if (ConfirmQuit(Ir) == TRUE)
368 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)
370 return(SELECT_PARTITION_PAGE);
374 return(INSTALL_INTRO_PAGE);
379 SelectPartitionPage(PINPUT_RECORD Ir)
385 SetTextXY(6, 8, "The list below shows existing partitions and unused disk");
386 SetTextXY(6, 9, "space for new partitions.");
388 SetTextXY(8, 11, "\xf9 Press UP or DOWN to select a list entry.");
389 SetTextXY(8, 13, "\xf9 Press ENTER to install ReactOS onto the selected partition.");
390 SetTextXY(8, 15, "\xf9 Press C to create a new partition.");
391 SetTextXY(8, 17, "\xf9 Press D to delete an existing partition.");
393 SetStatusText(" Please wait...");
395 GetScreenSize(&xScreen, &yScreen);
397 PartList = CreatePartitionList(2, 19, xScreen - 3, yScreen - 3);
398 if (PartList == NULL)
400 /* FIXME: show an error dialog */
404 SetStatusText(" ENTER = Continue F3 = Quit");
410 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
411 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3))
413 if (ConfirmQuit(Ir) == TRUE)
415 DestroyPartitionList(PartList);
420 else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
421 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_DOWN))
423 ScrollDownPartitionList(PartList);
425 else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
426 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_UP))
428 ScrollUpPartitionList(PartList);
430 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)
432 PartDataValid = GetPartitionData(PartList, &PartData);
433 DestroyPartitionList(PartList);
434 return(SELECT_FILE_SYSTEM_PAGE);
437 /* FIXME: Update status text */
441 DestroyPartitionList(PartList);
443 return(SELECT_PARTITION_PAGE);
448 SelectFileSystemPage(PINPUT_RECORD Ir)
456 if (PartDataValid == FALSE)
458 /* FIXME: show an error dialog */
462 /* adjust disk size */
463 if (PartData.DiskSize >= 0x280000000ULL) /* 10 GB */
465 DiskSize = (PartData.DiskSize + (1 << 29)) >> 30;
470 DiskSize = (PartData.DiskSize + (1 << 19)) >> 20;
474 /* adjust partition size */
475 if (PartData.PartSize >= 0x280000000ULL) /* 10 GB */
477 PartSize = (PartData.PartSize + (1 << 29)) >> 30;
482 PartSize = (PartData.PartSize + (1 << 19)) >> 20;
486 /* adjust partition type */
487 if ((PartData.PartType == PARTITION_FAT_12) ||
488 (PartData.PartType == PARTITION_FAT_16) ||
489 (PartData.PartType == PARTITION_HUGE) ||
490 (PartData.PartType == PARTITION_XINT13))
494 else if ((PartData.PartType == PARTITION_FAT32) ||
495 (PartData.PartType == PARTITION_FAT32_XINT13))
499 else if (PartData.PartType == PARTITION_IFS)
501 PartType = "NTFS"; /* FIXME: Not quite correct! */
505 PartType = "Unknown";
508 SetTextXY(6, 8, "ReactOS will be installed");
510 PrintTextXY(8, 9, "on Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu.",
518 PrintTextXY(8, 10, "on Partition %lu (%I64u %s) %s",
524 SetTextXY(6, 13, "Select a file system for the partition from the list below.");
526 SetTextXY(8, 15, "\xf9 Press UP or DOWN to select a file system.");
527 SetTextXY(8, 17, "\xf9 Press ENTER to format the partition.");
528 SetTextXY(8, 19, "\xf9 Press ESC to select another partition.");
530 /* FIXME: use a real list later */
531 SetInvertedTextXY(6, 22, " Keep current file system (no changes) ");
534 SetStatusText(" ENTER = Continue ESC = Cancel F3 = Quit");
540 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
541 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3))
543 if (ConfirmQuit(Ir) == TRUE)
547 else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
548 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE)) /* ESC */
550 return(SELECT_PARTITION_PAGE);
552 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
554 return(CHECK_FILE_SYSTEM_PAGE);
558 return(SELECT_FILE_SYSTEM_PAGE);
563 CheckFileSystemPage(PINPUT_RECORD Ir)
565 SetTextXY(6, 8, "Check file system");
567 SetTextXY(6, 10, "At present, ReactOS can not check file systems.");
569 SetStatusText(" Please wait ...");
572 SetStatusText(" ENTER = Continue F3 = Quit");
578 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
579 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3))
581 if (ConfirmQuit(Ir) == TRUE)
585 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
587 return(INSTALL_DIRECTORY_PAGE);
591 return(CHECK_FILE_SYSTEM_PAGE);
596 InstallDirectoryPage(PINPUT_RECORD Ir)
600 SetTextXY(6, 8, "Setup installs ReactOS files onto the selected partition. Choose a");
601 SetTextXY(6, 9, "directory where you want ReactOS to be installed:");
603 strcpy(InstallDir, "\\reactos");
604 Length = strlen(InstallDir);
606 SetInputTextXY(8, 11, 51, InstallDir);
608 SetTextXY(6, 14, "To change the suggested directory, press BACKSPACE to delete");
609 SetTextXY(6, 15, "characters and then type the directory where you want ReactOS to");
610 SetTextXY(6, 16, "be installed.");
613 SetStatusText(" ENTER = Continue F3 = Quit");
619 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
620 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3))
622 if (ConfirmQuit(Ir) == TRUE)
626 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
628 return(PREPARE_COPY_PAGE);
630 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x08) /* BACKSPACE */
635 InstallDir[Length] = 0;
636 SetInputTextXY(8, 11, 51, InstallDir);
639 else if (isprint(Ir->Event.KeyEvent.uChar.AsciiChar))
643 InstallDir[Length] = Ir->Event.KeyEvent.uChar.AsciiChar;
645 InstallDir[Length] = 0;
646 SetInputTextXY(8, 11, 51, InstallDir);
651 return(INSTALL_DIRECTORY_PAGE);
656 PrepareCopyPage(PINPUT_RECORD Ir)
658 OBJECT_ATTRIBUTES ObjectAttributes;
659 IO_STATUS_BLOCK IoStatusBlock;
660 CHAR PathBuffer[MAX_PATH];
661 UNICODE_STRING PathName;
662 HANDLE DirectoryHandle;
677 SetTextXY(6, 8, "Setup prepares your computer for copying the ReactOS files. ");
680 SetTextXY(8, 12, "Build file copy list");
682 SetTextXY(8, 14, "Create directories");
684 SetStatusText(" Please wait...");
687 /* build the file copy list */
689 SetInvertedTextXY(8, 12, "Build file copy list");
691 /* FIXME: build that list */
693 SetTextXY(8, 12, "Build file copy list");
694 SetHighlightedTextXY(50, 12, "Done");
697 /* create directories */
698 SetInvertedTextXY(8, 14, "Create directories");
702 * FIXME: Enumerate the ini section 'Directories' and create all "relative" directories
706 /* create the systemroot directory */
708 "\\Device\\Harddisk%lu\\Partition%lu",
710 PartData.PartNumber);
711 if (InstallDir[0] != '\\')
712 strcat(PathBuffer, "\\");
713 strcat(PathBuffer, InstallDir);
715 /* remove trailing backslash */
716 Length = strlen(PathBuffer);
717 if ((Length > 0) && (PathBuffer[Length - 1] == '\\'))
718 PathBuffer[Length - 1] = 0;
720 RtlCreateUnicodeStringFromAsciiz(&PathName,
723 ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
724 ObjectAttributes.RootDirectory = NULL;
725 ObjectAttributes.ObjectName = &PathName;
726 ObjectAttributes.Attributes = OBJ_CASE_INSENSITIVE | OBJ_INHERIT;
727 ObjectAttributes.SecurityDescriptor = NULL;
728 ObjectAttributes.SecurityQualityOfService = NULL;
730 Status = NtCreateFile(&DirectoryHandle,
731 DIRECTORY_ALL_ACCESS,
735 FILE_ATTRIBUTE_DIRECTORY,
741 if (!NT_SUCCESS(Status))
743 PrintTextXY(6, 25, "Creating directory failed: Status = 0x%08lx", Status);
748 PrintTextXY(6, 25, "Created directory.");
749 NtClose (DirectoryHandle);
753 RtlFreeUnicodeString(&PathName);
756 /* create the subdirectories */
758 /* append backslash and init end pointer */
759 strcat(PathBuffer, "\\");
760 Length = strlen(PathBuffer);
761 End = &PathBuffer[Length];
763 for (i = 0; Dirs[i] != NULL; i++)
765 strcpy(End, Dirs[i]);
768 RtlCreateUnicodeStringFromAsciiz(&PathName,
772 ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
773 ObjectAttributes.RootDirectory = NULL;
774 ObjectAttributes.ObjectName = &PathName;
775 ObjectAttributes.Attributes = OBJ_CASE_INSENSITIVE | OBJ_INHERIT;
776 ObjectAttributes.SecurityDescriptor = NULL;
777 ObjectAttributes.SecurityQualityOfService = NULL;
779 Status = NtCreateFile(&DirectoryHandle,
780 DIRECTORY_ALL_ACCESS,
784 FILE_ATTRIBUTE_DIRECTORY,
790 if (!NT_SUCCESS(Status))
792 PrintTextXY(6, 25, "Creating directory failed: Status = 0x%08lx", Status);
796 PrintTextXY(6, 25, "Created directory.");
797 NtClose (DirectoryHandle);
800 RtlFreeUnicodeString(&PathName);
804 SetTextXY(8, 14, "Create directories");
805 SetHighlightedTextXY(50, 14, "Done");
808 SetStatusText(" ENTER = Continue F3 = Quit");
814 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
815 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
817 if (ConfirmQuit(Ir) == TRUE)
821 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)
823 return(FILE_COPY_PAGE);
827 return(PREPARE_COPY_PAGE);
832 FileCopyPage(PINPUT_RECORD Ir)
835 SetTextXY(6, 8, "Copying files");
838 SetStatusText(" ENTER = Continue F3 = Quit");
844 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
845 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
847 if (ConfirmQuit(Ir) == TRUE)
851 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)
853 return(INIT_SYSTEM_PAGE);
857 return(FILE_COPY_PAGE);
863 UpdateSystemRootLink(VOID)
865 OBJECT_ATTRIBUTES ObjectAttributes;
866 UNICODE_STRING LinkName;
867 UNICODE_STRING TargetName;
868 CHAR TargetBuffer[MAX_PATH];
872 RtlInitUnicodeString(&LinkName,
875 InitializeObjectAttributes(&ObjectAttributes,
881 Status = NtOpenSymbolicLinkObject(&Handle,
882 SYMBOLIC_LINK_ALL_ACCESS,
884 if (!NT_SUCCESS(Status))
887 Status = NtMakeTemporaryObject(Handle);
889 if (!NT_SUCCESS(Status))
892 sprintf(TargetBuffer,
893 "\\Device\\Harddisk%lu\\Partition%lu",
895 PartData.PartNumber);
896 if (InstallDir[0] != '\\')
897 strcat(TargetBuffer, "\\");
898 strcat(TargetBuffer, InstallDir);
900 RtlCreateUnicodeStringFromAsciiz(&TargetName,
903 Status = NtCreateSymbolicLinkObject(&Handle,
904 SYMBOLIC_LINK_ALL_ACCESS,
908 RtlFreeUnicodeString(&TargetName);
910 if (!NT_SUCCESS(Status))
915 return(STATUS_SUCCESS);
921 InitSystemPage(PINPUT_RECORD Ir)
927 SetTextXY(6, 8, "Initializing system settings");
930 SetTextXY(6, 12, "Create registry hives");
932 SetTextXY(6, 14, "Update registry hives");
934 SetTextXY(6, 16, "Install/update boot manager");
936 SetStatusText(" Please wait...");
940 * Initialize registry
943 /* Update 'SystemRoot' link */
944 Status = UpdateSystemRootLink();
945 if (!NT_SUCCESS(Status))
948 PrintTextXY(6, 25, "UpdateSystemRootLink() failed (Status = 0x%08lx)", Status);
952 Status = NtInitializeRegistry(TRUE);
953 if (!NT_SUCCESS(Status))
956 PrintTextXY(6, 26, "NtInitializeRegistry() failed (Status = 0x%08lx)", Status);
964 /* FIXME: Create key '\Registry\Machine\System\Setup' */
966 /* FIXME: Create value 'SystemSetupInProgress' */
970 SetStatusText(" ENTER = Continue F3 = Quit");
976 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
977 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3))
979 if (ConfirmQuit(Ir) == TRUE)
983 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)
985 return(SUCCESS_PAGE);
989 return(INIT_SYSTEM_PAGE);
994 QuitPage(PINPUT_RECORD Ir)
996 SetTextXY(10, 6, "ReactOS is not completely installed");
998 SetTextXY(10, 8, "Remove floppy disk from Drive A: and");
999 SetTextXY(10, 9, "all CD-ROMs from CD-Drive.");
1001 SetTextXY(10, 11, "Press ENTER to reboot your computer.");
1003 SetStatusText(" ENTER = Reboot computer");
1009 if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)
1011 return(REBOOT_PAGE);
1018 SuccessPage(PINPUT_RECORD Ir)
1020 SetTextXY(10, 6, "The basic components of ReactOS have been installed successfully.");
1022 SetTextXY(10, 8, "Remove floppy disk from Drive A: and");
1023 SetTextXY(10, 9, "all CD-ROMs from CD-Drive.");
1025 SetTextXY(10, 11, "Press ENTER to reboot your computer.");
1027 SetStatusText(" ENTER = Reboot computer");
1033 if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)
1035 return(REBOOT_PAGE);
1042 NtProcessStartup(PPEB Peb)
1048 RtlNormalizeProcessParams(Peb->ProcessParameters);
1050 ProcessHeap = Peb->ProcessHeap;
1052 Status = AllocConsole();
1053 if (!NT_SUCCESS(Status))
1055 PrintString("AllocConsole() failed (Status = 0x%08lx)\n", Status);
1057 /* Raise a hard error (crash the system/BSOD) */
1058 NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED,
1063 while (Page != REBOOT_PAGE)
1067 SetUnderlinedTextXY(4, 3, " ReactOS 0.0.20 Setup ");
1073 Page = StartPage(&Ir);
1078 Page = IntroPage(&Ir);
1082 case INSTALL_INTRO_PAGE:
1083 Page = InstallIntroPage(&Ir);
1087 case OEM_DRIVER_PAGE:
1088 Page = OemDriverPage(&Ir);
1093 case DEVICE_SETTINGS_PAGE:
1096 case SELECT_PARTITION_PAGE:
1097 Page = SelectPartitionPage(&Ir);
1100 case SELECT_FILE_SYSTEM_PAGE:
1101 Page = SelectFileSystemPage(&Ir);
1104 case CHECK_FILE_SYSTEM_PAGE:
1105 Page = CheckFileSystemPage(&Ir);
1108 case INSTALL_DIRECTORY_PAGE:
1109 Page = InstallDirectoryPage(&Ir);
1112 case PREPARE_COPY_PAGE:
1113 Page = PrepareCopyPage(&Ir);
1116 case FILE_COPY_PAGE:
1117 Page = FileCopyPage(&Ir);
1120 case INIT_SYSTEM_PAGE:
1121 Page = InitSystemPage(&Ir);
1126 case REPAIR_INTRO_PAGE:
1127 Page = RepairIntroPage(&Ir);
1132 Page = SuccessPage(&Ir);
1136 Page = QuitPage(&Ir);
1143 NtShutdownSystem(ShutdownReboot);