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 * Number of the next page.
211 StartPage(PINPUT_RECORD Ir)
215 SetStatusText(" Please wait...");
217 Status = GetSourcePaths(&SourcePath,
219 if (!NT_SUCCESS(Status))
221 PrintTextXY(6, 15, "GetSourcePath() failed (Status 0x%08lx)", Status);
225 PrintTextXY(6, 15, "SourcePath: '%wZ'", &SourcePath);
226 PrintTextXY(6, 16, "SourceRootPath: '%wZ'", &SourceRootPath);
230 * FIXME: Open and load txtsetup.sif here. A pointer (or handle) to the
231 * ini data should be stored in a global variable.
232 * The full path to txtsetup.sif is created by appending '\txtsetup.sif'
233 * to the unicode string SourceRootPath.
236 SetStatusText(" ENTER = Continue");
242 if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
254 RepairIntroPage(PINPUT_RECORD Ir)
256 SetTextXY(6, 8, "ReactOS Setup is in an early development phase. It does not yet");
257 SetTextXY(6, 9, "support all the functions of a fully usable setup application.");
259 SetTextXY(6, 12, "The repair functions are not implemented yet.");
261 SetTextXY(8, 15, "\xf9 Press ESC to return to the main page.");
263 SetTextXY(8, 17, "\xf9 Press ENTER to reboot your computer.");
265 SetStatusText(" ESC = Main page ENTER = Reboot");
271 if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
275 else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
276 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE)) /* ESC */
282 return(REPAIR_INTRO_PAGE);
289 * TRUE: setup/repair completed successfully
290 * FALSE: setup/repair terminated by user
293 IntroPage(PINPUT_RECORD Ir)
295 SetHighlightedTextXY(6, 8, "Welcome to ReactOS Setup");
297 SetTextXY(6, 11, "This part of the setup copies the ReactOS Operating System to your");
298 SetTextXY(6, 12, "computer and prepares the second part of the setup.");
300 SetTextXY(8, 15, "\xf9 Press ENTER to install ReactOS.");
302 SetTextXY(8, 17, "\xf9 Press E to start the emergency repair console.");
304 SetTextXY(8, 19, "\xf9 Press R to repair ReactOS.");
306 SetTextXY(8, 21, "\xf9 Press F3 to quit without installing ReactOS.");
309 SetStatusText(" ENTER = Continue F3 = Quit");
315 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
316 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
318 if (ConfirmQuit(Ir) == TRUE)
322 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
324 return(INSTALL_INTRO_PAGE);
327 else if (toupper(Ir->Event.KeyEvent.uChar.AsciiChar) == 'E') /* E */
329 return(RepairConsole());
332 else if (toupper(Ir->Event.KeyEvent.uChar.AsciiChar) == 'R') /* R */
334 return(REPAIR_INTRO_PAGE);
343 InstallIntroPage(PINPUT_RECORD Ir)
345 SetTextXY(6, 8, "ReactOS Setup is in an early development phase. It does not yet");
346 SetTextXY(6, 9, "support all the functions of a fully usable setup application.");
348 SetTextXY(6, 12, "The following functions are missing:");
349 SetTextXY(8, 13, "- Creating and deleting harddisk partitions.");
350 SetTextXY(8, 14, "- Formatting partitions.");
351 SetTextXY(8, 15, "- Support for non-FAT file systems.");
352 SetTextXY(8, 16, "- Checking file systems.");
353 SetTextXY(8, 17, "- Installing the bootloader.");
357 SetTextXY(8, 21, "\xf9 Press ENTER to install ReactOS.");
359 SetTextXY(8, 23, "\xf9 Press F3 to quit without installing ReactOS.");
362 SetStatusText(" ENTER = Continue F3 = Quit");
368 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
369 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
371 if (ConfirmQuit(Ir) == TRUE)
375 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
377 return(SELECT_PARTITION_PAGE);
381 return(INSTALL_INTRO_PAGE);
386 SelectPartitionPage(PINPUT_RECORD Ir)
392 SetTextXY(6, 8, "The list below shows existing partitions and unused disk");
393 SetTextXY(6, 9, "space for new partitions.");
395 SetTextXY(8, 11, "\xf9 Press UP or DOWN to select a list entry.");
396 SetTextXY(8, 13, "\xf9 Press ENTER to install ReactOS onto the selected partition.");
397 SetTextXY(8, 15, "\xf9 Press C to create a new partition.");
398 SetTextXY(8, 17, "\xf9 Press D to delete an existing partition.");
400 SetStatusText(" Please wait...");
402 GetScreenSize(&xScreen, &yScreen);
404 PartList = CreatePartitionList(2, 19, xScreen - 3, yScreen - 3);
405 if (PartList == NULL)
407 /* FIXME: show an error dialog */
411 SetStatusText(" ENTER = Continue F3 = Quit");
417 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
418 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
420 if (ConfirmQuit(Ir) == TRUE)
422 DestroyPartitionList(PartList);
427 else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
428 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_DOWN)) /* DOWN */
430 ScrollDownPartitionList(PartList);
432 else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
433 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_UP)) /* UP */
435 ScrollUpPartitionList(PartList);
437 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
439 PartDataValid = GetPartitionData(PartList, &PartData);
440 DestroyPartitionList(PartList);
441 return(SELECT_FILE_SYSTEM_PAGE);
444 /* FIXME: Update status text */
448 DestroyPartitionList(PartList);
450 return(SELECT_PARTITION_PAGE);
455 SelectFileSystemPage(PINPUT_RECORD Ir)
463 if (PartDataValid == FALSE)
465 /* FIXME: show an error dialog */
469 /* adjust disk size */
470 if (PartData.DiskSize >= 0x280000000ULL) /* 10 GB */
472 DiskSize = (PartData.DiskSize + (1 << 29)) >> 30;
477 DiskSize = (PartData.DiskSize + (1 << 19)) >> 20;
481 /* adjust partition size */
482 if (PartData.PartSize >= 0x280000000ULL) /* 10 GB */
484 PartSize = (PartData.PartSize + (1 << 29)) >> 30;
489 PartSize = (PartData.PartSize + (1 << 19)) >> 20;
493 /* adjust partition type */
494 if ((PartData.PartType == PARTITION_FAT_12) ||
495 (PartData.PartType == PARTITION_FAT_16) ||
496 (PartData.PartType == PARTITION_HUGE) ||
497 (PartData.PartType == PARTITION_XINT13))
501 else if ((PartData.PartType == PARTITION_FAT32) ||
502 (PartData.PartType == PARTITION_FAT32_XINT13))
506 else if (PartData.PartType == PARTITION_IFS)
508 PartType = "NTFS"; /* FIXME: Not quite correct! */
512 PartType = "Unknown";
515 SetTextXY(6, 8, "ReactOS will be installed");
517 PrintTextXY(8, 9, "on Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu.",
525 PrintTextXY(8, 10, "on Partition %lu (%I64u %s) %s",
531 SetTextXY(6, 13, "Select a file system for the partition from the list below.");
533 SetTextXY(8, 15, "\xf9 Press UP or DOWN to select a file system.");
534 SetTextXY(8, 17, "\xf9 Press ENTER to format the partition.");
535 SetTextXY(8, 19, "\xf9 Press ESC to select another partition.");
537 /* FIXME: use a real list later */
538 SetInvertedTextXY(6, 22, " Keep current file system (no changes) ");
541 SetStatusText(" ENTER = Continue ESC = Cancel F3 = Quit");
547 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
548 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
550 if (ConfirmQuit(Ir) == TRUE)
554 else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
555 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE)) /* ESC */
557 return(SELECT_PARTITION_PAGE);
559 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
561 return(CHECK_FILE_SYSTEM_PAGE);
565 return(SELECT_FILE_SYSTEM_PAGE);
570 CheckFileSystemPage(PINPUT_RECORD Ir)
572 SetTextXY(6, 8, "Check file system");
574 SetTextXY(6, 10, "At present, ReactOS can not check file systems.");
576 SetStatusText(" Please wait ...");
579 SetStatusText(" ENTER = Continue F3 = Quit");
585 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
586 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
588 if (ConfirmQuit(Ir) == TRUE)
592 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
594 return(INSTALL_DIRECTORY_PAGE);
598 return(CHECK_FILE_SYSTEM_PAGE);
603 InstallDirectoryPage(PINPUT_RECORD Ir)
607 SetTextXY(6, 8, "Setup installs ReactOS files onto the selected partition. Choose a");
608 SetTextXY(6, 9, "directory where you want ReactOS to be installed:");
610 strcpy(InstallDir, "\\reactos");
611 Length = strlen(InstallDir);
613 SetInputTextXY(8, 11, 51, InstallDir);
615 SetTextXY(6, 14, "To change the suggested directory, press BACKSPACE to delete");
616 SetTextXY(6, 15, "characters and then type the directory where you want ReactOS to");
617 SetTextXY(6, 16, "be installed.");
620 SetStatusText(" ENTER = Continue F3 = Quit");
626 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
627 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
629 if (ConfirmQuit(Ir) == TRUE)
633 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
635 return(PREPARE_COPY_PAGE);
637 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x08) /* BACKSPACE */
642 InstallDir[Length] = 0;
643 SetInputTextXY(8, 11, 51, InstallDir);
646 else if (isprint(Ir->Event.KeyEvent.uChar.AsciiChar))
650 InstallDir[Length] = Ir->Event.KeyEvent.uChar.AsciiChar;
652 InstallDir[Length] = 0;
653 SetInputTextXY(8, 11, 51, InstallDir);
658 return(INSTALL_DIRECTORY_PAGE);
663 PrepareCopyPage(PINPUT_RECORD Ir)
665 OBJECT_ATTRIBUTES ObjectAttributes;
666 IO_STATUS_BLOCK IoStatusBlock;
667 CHAR PathBuffer[MAX_PATH];
668 UNICODE_STRING PathName;
669 HANDLE DirectoryHandle;
684 SetTextXY(6, 8, "Setup prepares your computer for copying the ReactOS files. ");
687 SetTextXY(8, 12, "Build file copy list");
689 SetTextXY(8, 14, "Create directories");
691 SetStatusText(" Please wait...");
694 /* build the file copy list */
696 SetInvertedTextXY(8, 12, "Build file copy list");
698 /* FIXME: build that list */
700 SetTextXY(8, 12, "Build file copy list");
701 SetHighlightedTextXY(50, 12, "Done");
704 /* create directories */
705 SetInvertedTextXY(8, 14, "Create directories");
709 * FIXME: Enumerate the ini section 'Directories' and create all "relative" directories
713 /* create the systemroot directory */
715 "\\Device\\Harddisk%lu\\Partition%lu",
717 PartData.PartNumber);
718 if (InstallDir[0] != '\\')
719 strcat(PathBuffer, "\\");
720 strcat(PathBuffer, InstallDir);
722 /* remove trailing backslash */
723 Length = strlen(PathBuffer);
724 if ((Length > 0) && (PathBuffer[Length - 1] == '\\'))
725 PathBuffer[Length - 1] = 0;
727 RtlCreateUnicodeStringFromAsciiz(&PathName,
730 ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
731 ObjectAttributes.RootDirectory = NULL;
732 ObjectAttributes.ObjectName = &PathName;
733 ObjectAttributes.Attributes = OBJ_CASE_INSENSITIVE | OBJ_INHERIT;
734 ObjectAttributes.SecurityDescriptor = NULL;
735 ObjectAttributes.SecurityQualityOfService = NULL;
737 Status = NtCreateFile(&DirectoryHandle,
738 DIRECTORY_ALL_ACCESS,
742 FILE_ATTRIBUTE_DIRECTORY,
748 if (!NT_SUCCESS(Status))
750 PrintTextXY(6, 25, "Creating directory failed: Status = 0x%08lx", Status);
755 PrintTextXY(6, 25, "Created directory.");
756 NtClose (DirectoryHandle);
760 RtlFreeUnicodeString(&PathName);
763 /* create the subdirectories */
765 /* append backslash and init end pointer */
766 strcat(PathBuffer, "\\");
767 Length = strlen(PathBuffer);
768 End = &PathBuffer[Length];
770 for (i = 0; Dirs[i] != NULL; i++)
772 strcpy(End, Dirs[i]);
775 RtlCreateUnicodeStringFromAsciiz(&PathName,
779 ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
780 ObjectAttributes.RootDirectory = NULL;
781 ObjectAttributes.ObjectName = &PathName;
782 ObjectAttributes.Attributes = OBJ_CASE_INSENSITIVE | OBJ_INHERIT;
783 ObjectAttributes.SecurityDescriptor = NULL;
784 ObjectAttributes.SecurityQualityOfService = NULL;
786 Status = NtCreateFile(&DirectoryHandle,
787 DIRECTORY_ALL_ACCESS,
791 FILE_ATTRIBUTE_DIRECTORY,
797 if (!NT_SUCCESS(Status))
799 PrintTextXY(6, 25, "Creating directory failed: Status = 0x%08lx", Status);
803 PrintTextXY(6, 25, "Created directory.");
804 NtClose (DirectoryHandle);
807 RtlFreeUnicodeString(&PathName);
811 SetTextXY(8, 14, "Create directories");
812 SetHighlightedTextXY(50, 14, "Done");
815 SetStatusText(" ENTER = Continue F3 = Quit");
821 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
822 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
824 if (ConfirmQuit(Ir) == TRUE)
828 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
830 return(FILE_COPY_PAGE);
834 return(PREPARE_COPY_PAGE);
839 FileCopyPage(PINPUT_RECORD Ir)
842 SetTextXY(6, 8, "Copying files");
845 SetStatusText(" ENTER = Continue F3 = Quit");
851 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
852 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
854 if (ConfirmQuit(Ir) == TRUE)
858 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
860 return(INIT_SYSTEM_PAGE);
864 return(FILE_COPY_PAGE);
870 UpdateSystemRootLink(VOID)
872 OBJECT_ATTRIBUTES ObjectAttributes;
873 UNICODE_STRING LinkName;
874 UNICODE_STRING TargetName;
875 CHAR TargetBuffer[MAX_PATH];
879 RtlInitUnicodeString(&LinkName,
882 InitializeObjectAttributes(&ObjectAttributes,
888 Status = NtOpenSymbolicLinkObject(&Handle,
889 SYMBOLIC_LINK_ALL_ACCESS,
891 if (!NT_SUCCESS(Status))
894 Status = NtMakeTemporaryObject(Handle);
896 if (!NT_SUCCESS(Status))
899 sprintf(TargetBuffer,
900 "\\Device\\Harddisk%lu\\Partition%lu",
902 PartData.PartNumber);
903 if (InstallDir[0] != '\\')
904 strcat(TargetBuffer, "\\");
905 strcat(TargetBuffer, InstallDir);
907 RtlCreateUnicodeStringFromAsciiz(&TargetName,
910 Status = NtCreateSymbolicLinkObject(&Handle,
911 SYMBOLIC_LINK_ALL_ACCESS,
915 RtlFreeUnicodeString(&TargetName);
917 if (!NT_SUCCESS(Status))
922 return(STATUS_SUCCESS);
928 InitSystemPage(PINPUT_RECORD Ir)
934 SetTextXY(6, 8, "Initializing system settings");
937 SetTextXY(6, 12, "Create registry hives");
939 SetTextXY(6, 14, "Update registry hives");
941 SetTextXY(6, 16, "Install/update boot manager");
943 SetStatusText(" Please wait...");
947 * Initialize registry
950 /* Update 'SystemRoot' link */
951 Status = UpdateSystemRootLink();
952 if (!NT_SUCCESS(Status))
955 PrintTextXY(6, 25, "UpdateSystemRootLink() failed (Status = 0x%08lx)", Status);
959 Status = NtInitializeRegistry(TRUE);
960 if (!NT_SUCCESS(Status))
963 PrintTextXY(6, 26, "NtInitializeRegistry() failed (Status = 0x%08lx)", Status);
971 /* FIXME: Create key '\Registry\Machine\System\Setup' */
973 /* FIXME: Create value 'SystemSetupInProgress' */
977 SetStatusText(" ENTER = Continue F3 = Quit");
983 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
984 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
986 if (ConfirmQuit(Ir) == TRUE)
990 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
992 return(SUCCESS_PAGE);
996 return(INIT_SYSTEM_PAGE);
1001 QuitPage(PINPUT_RECORD Ir)
1003 SetTextXY(10, 6, "ReactOS is not completely installed");
1005 SetTextXY(10, 8, "Remove floppy disk from Drive A: and");
1006 SetTextXY(10, 9, "all CD-ROMs from CD-Drive.");
1008 SetTextXY(10, 11, "Press ENTER to reboot your computer.");
1010 SetStatusText(" ENTER = Reboot computer");
1016 if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
1018 return(REBOOT_PAGE);
1025 SuccessPage(PINPUT_RECORD Ir)
1027 SetTextXY(10, 6, "The basic components of ReactOS have been installed successfully.");
1029 SetTextXY(10, 8, "Remove floppy disk from Drive A: and");
1030 SetTextXY(10, 9, "all CD-ROMs from CD-Drive.");
1032 SetTextXY(10, 11, "Press ENTER to reboot your computer.");
1034 SetStatusText(" ENTER = Reboot computer");
1040 if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
1042 return(REBOOT_PAGE);
1049 NtProcessStartup(PPEB Peb)
1055 RtlNormalizeProcessParams(Peb->ProcessParameters);
1057 ProcessHeap = Peb->ProcessHeap;
1059 Status = AllocConsole();
1060 if (!NT_SUCCESS(Status))
1062 PrintString("AllocConsole() failed (Status = 0x%08lx)\n", Status);
1064 /* Raise a hard error (crash the system/BSOD) */
1065 NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED,
1070 while (Page != REBOOT_PAGE)
1074 SetUnderlinedTextXY(4, 3, " ReactOS 0.0.20 Setup ");
1080 Page = StartPage(&Ir);
1085 Page = IntroPage(&Ir);
1089 case INSTALL_INTRO_PAGE:
1090 Page = InstallIntroPage(&Ir);
1094 case OEM_DRIVER_PAGE:
1095 Page = OemDriverPage(&Ir);
1100 case DEVICE_SETTINGS_PAGE:
1103 case SELECT_PARTITION_PAGE:
1104 Page = SelectPartitionPage(&Ir);
1107 case SELECT_FILE_SYSTEM_PAGE:
1108 Page = SelectFileSystemPage(&Ir);
1111 case CHECK_FILE_SYSTEM_PAGE:
1112 Page = CheckFileSystemPage(&Ir);
1115 case INSTALL_DIRECTORY_PAGE:
1116 Page = InstallDirectoryPage(&Ir);
1119 case PREPARE_COPY_PAGE:
1120 Page = PrepareCopyPage(&Ir);
1123 case FILE_COPY_PAGE:
1124 Page = FileCopyPage(&Ir);
1127 case INIT_SYSTEM_PAGE:
1128 Page = InitSystemPage(&Ir);
1133 case REPAIR_INTRO_PAGE:
1134 Page = RepairIntroPage(&Ir);
1139 Page = SuccessPage(&Ir);
1143 Page = QuitPage(&Ir);
1150 NtShutdownSystem(ShutdownReboot);