Added more setup 'pages'. No install functionality yet.
[reactos.git] / reactos / subsys / system / usetup / usetup.c
1 /*
2 * ReactOS kernel
3 * Copyright (C) 2002 ReactOS Team
4 *
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.
9 *
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.
14 *
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.
18 */
19 /* $Id: usetup.c,v 1.3 2002/09/25 14:48:35 ekohl Exp $
20 *
21 * COPYRIGHT: See COPYING in the top level directory
22 * PROJECT: ReactOS user-mode setup application
23 * FILE: subsys/system/usetup/usetup.c
24 * PURPOSE: setup application
25 * PROGRAMMERS: Eric Kohl (ekohl@rz-online.de)
26 */
27
28 #include <ddk/ntddk.h>
29 #include <ddk/ntddblue.h>
30 #include <ddk/ntddscsi.h>
31
32 #include <ntdll/rtl.h>
33
34 #include <ntos/keyboard.h>
35
36 #include "usetup.h"
37
38
39 #define INTRO_PAGE 0
40 #define INSTALL_INTRO_PAGE 1
41
42 #define CHOOSE_PARTITION_PAGE 3
43 #define SELECT_FILE_SYSTEM_PAGE 4
44 #define CHECK_FILE_SYSTEM_PAGE 5
45 #define PREPARE_COPY_PAGE 6
46 #define INSTALL_DIRECTORY_PAGE 7
47 #define FILE_COPY_PAGE 8
48 #define INIT_SYSTEM_PAGE 9
49
50 #define SUCCESS_PAGE 100
51 #define QUIT_PAGE 101
52 #define REBOOT_PAGE 102
53
54
55 HANDLE ProcessHeap;
56
57 /* FUNCTIONS ****************************************************************/
58
59 void
60 DisplayString(LPCWSTR lpwString)
61 {
62 UNICODE_STRING us;
63
64 RtlInitUnicodeString(&us, lpwString);
65 NtDisplayString(&us);
66 }
67
68
69 void
70 PrintString(char* fmt,...)
71 {
72 char buffer[512];
73 va_list ap;
74 UNICODE_STRING UnicodeString;
75 ANSI_STRING AnsiString;
76
77 va_start(ap, fmt);
78 vsprintf(buffer, fmt, ap);
79 va_end(ap);
80
81 RtlInitAnsiString(&AnsiString, buffer);
82 RtlAnsiStringToUnicodeString(&UnicodeString,
83 &AnsiString,
84 TRUE);
85 NtDisplayString(&UnicodeString);
86 RtlFreeUnicodeString(&UnicodeString);
87 }
88
89
90 /*
91 * Confirm quit setup
92 * RETURNS
93 * TRUE: Quit setup.
94 * FALSE: Don't quit setup.
95 */
96 static BOOL
97 ConfirmQuit(PINPUT_RECORD Ir)
98 {
99 SHORT xScreen;
100 SHORT yScreen;
101 SHORT yTop;
102 SHORT xLeft;
103 BOOL Result = FALSE;
104 PUSHORT pAttributes = NULL;
105 PUCHAR pCharacters = NULL;
106 COORD Pos;
107
108 GetScreenSize(&xScreen, &yScreen);
109 yTop = (yScreen - 10) / 2;
110 xLeft = (xScreen - 52) / 2;
111
112 /* Save screen */
113 #if 0
114 Pos.X = 0;
115 Pos.Y = 0;
116 pAttributes = (PUSHORT)RtlAllocateHeap(ProcessHeap,
117 0,
118 xScreen * yScreen * sizeof(USHORT));
119 CHECKPOINT1;
120 DPRINT1("pAttributes %p\n", pAttributes);
121 ReadConsoleOutputAttributes(pAttributes,
122 xScreen * yScreen,
123 Pos,
124 NULL);
125 CHECKPOINT1;
126 pCharacters = (PUCHAR)RtlAllocateHeap(ProcessHeap,
127 0,
128 xScreen * yScreen * sizeof(UCHAR));
129 CHECKPOINT1;
130 ReadConsoleOutputCharacters(pCharacters,
131 xScreen * yScreen,
132 Pos,
133 NULL);
134 CHECKPOINT1;
135 #endif
136
137 /* Draw popup window */
138 SetTextXY(xLeft, yTop,
139 "+----------------------------------------------------+");
140 SetTextXY(xLeft, yTop + 1,
141 "| ReactOS 0.0.20 is not completely installed on your |");
142 SetTextXY(xLeft, yTop + 2,
143 "| computer. If you quit Setup now, you will need to |");
144 SetTextXY(xLeft, yTop + 3,
145 "| run Setup again to install ReactOS. |");
146 SetTextXY(xLeft, yTop + 4,
147 "| |");
148 SetTextXY(xLeft, yTop + 5,
149 "| * Press ENTER to continue Setup. |");
150 SetTextXY(xLeft, yTop + 6,
151 "| * Press F3 to quit Setup. |");
152 SetTextXY(xLeft, yTop + 7,
153 "+----------------------------------------------------+");
154 SetTextXY(xLeft, yTop + 8,
155 "| F3= Quit ENTER = Continue |");
156 SetTextXY(xLeft, yTop + 9,
157 "+----------------------------------------------------+");
158
159 while(TRUE)
160 {
161 ConInKey(Ir);
162
163 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
164 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3))
165 {
166 Result = TRUE;
167 break;
168 }
169 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)
170 {
171 Result = FALSE;
172 break;
173 }
174 }
175
176 /* Restore screen */
177 #if 0
178 CHECKPOINT1;
179 WriteConsoleOutputAttributes(pAttributes,
180 xScreen * yScreen,
181 Pos,
182 NULL);
183 CHECKPOINT1;
184
185 WriteConsoleOutputCharacters(pCharacters,
186 xScreen * yScreen,
187 Pos);
188 CHECKPOINT1;
189
190 RtlFreeHeap(ProcessHeap,
191 0,
192 pAttributes);
193 RtlFreeHeap(ProcessHeap,
194 0,
195 pCharacters);
196 #endif
197
198 return(Result);
199 }
200
201
202
203
204
205
206
207 #if 0
208 static ULONG
209 RepairIntroPage(PINPUT_RECORD Ir)
210 {
211
212 }
213 #endif
214
215
216 /*
217 * First setup page
218 * RETURNS
219 * TRUE: setup/repair completed successfully
220 * FALSE: setup/repair terminated by user
221 */
222 static ULONG
223 IntroPage(PINPUT_RECORD Ir)
224 {
225 SetTextXY(6, 8, "Welcome to the ReactOS Setup");
226
227 SetTextXY(6, 11, "This part of the setup copies the ReactOS Operating System to your");
228 SetTextXY(6, 12, "computer and prepares the second part of the setup.");
229
230 SetTextXY(8, 15, "\xf9 Press ENTER to install ReactOS.");
231
232 #if 0
233 SetTextXY(8, 17, "\xf9 Press R to repair ReactOS.");
234 SetTextXY(8, 19, "\xf9 Press F3 to quit without installing ReactOS.");
235 #endif
236
237 SetTextXY(8, 17, "\xf9 Press F3 to quit without installing ReactOS.");
238
239 SetStatusText(" ENTER = Continue F3 = Quit");
240
241 while(TRUE)
242 {
243 ConInKey(Ir);
244
245 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
246 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3))
247 {
248 if (ConfirmQuit(Ir) == TRUE)
249 return(QUIT_PAGE);
250 break;
251 }
252 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)
253 {
254 return(INSTALL_INTRO_PAGE);
255 }
256 #if 0
257 else if (toupper(Ir->Event.KeyEvent.uChar.AsciiChar) == 'R')
258 {
259 return(REPAIR_INTRO_PAGE);
260 }
261 #endif
262 }
263
264 return(INTRO_PAGE);
265 }
266
267
268 static ULONG
269 InstallIntroPage(PINPUT_RECORD Ir)
270 {
271 SetTextXY(6, 8, "Install intro page");
272
273 #if 0
274 SetTextXY(6, 10, "This part of the setup copies the ReactOS Operating System to your");
275 SetTextXY(6, 11, "computer and prepairs the second part of the setup.");
276
277 SetTextXY(8, 14, "\xf9 Press ENTER to start the ReactOS setup.");
278
279 SetTextXY(8, 17, "\xf9 Press F3 to quit without installing ReactOS.");
280 #endif
281
282 SetStatusText(" ENTER = Continue F3 = Quit");
283
284 while(TRUE)
285 {
286 ConInKey(Ir);
287
288 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
289 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3))
290 {
291 if (ConfirmQuit(Ir) == TRUE)
292 return(QUIT_PAGE);
293 break;
294 }
295 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)
296 {
297 /* FIXME: Preliminary exit */
298 return(CHOOSE_PARTITION_PAGE);
299 }
300 }
301
302 return(INSTALL_INTRO_PAGE);
303 }
304
305
306 static ULONG
307 ChoosePartitionPage(PINPUT_RECORD Ir)
308 {
309 OBJECT_ATTRIBUTES ObjectAttributes;
310 SYSTEM_DEVICE_INFORMATION Sdi;
311 DISK_GEOMETRY DiskGeometry;
312 ULONG ReturnSize;
313 NTSTATUS Status;
314 ULONG DiskCount;
315 IO_STATUS_BLOCK Iosb;
316 WCHAR Buffer[MAX_PATH];
317 UNICODE_STRING Name;
318 HANDLE FileHandle;
319 ULONG Line;
320 ULONG i;
321
322 DRIVE_LAYOUT_INFORMATION *LayoutBuffer;
323 SCSI_ADDRESS ScsiAddress;
324 ULONGLONG DiskSize;
325 char *Scale;
326 char *PartType;
327
328
329
330 SetTextXY(6, 8, "Choose install partition");
331
332 Status = NtQuerySystemInformation(SystemDeviceInformation,
333 &Sdi,
334 sizeof(SYSTEM_DEVICE_INFORMATION),
335 &ReturnSize);
336 if (!NT_SUCCESS(Status))
337 {
338 SetTextXY(8, 10, "NtQuerySystemInformation failed!");
339 }
340
341 PrintTextXY(6, 12, "Setup found %lu %s on this computer.",
342 Sdi.NumberOfDisks, (Sdi.NumberOfDisks == 1) ? "harddisk" : "harddisks");
343
344 Line = 14;
345 for (DiskCount = 0; DiskCount < Sdi.NumberOfDisks; DiskCount++)
346 {
347 swprintf(Buffer,
348 L"\\Device\\Harddisk%d\\Partition0",
349 DiskCount);
350 RtlInitUnicodeString(&Name,
351 Buffer);
352
353 InitializeObjectAttributes(&ObjectAttributes,
354 &Name,
355 0,
356 NULL,
357 NULL);
358
359 Status = NtOpenFile(&FileHandle,
360 0x10001,
361 &ObjectAttributes,
362 &Iosb,
363 1,
364 FILE_SYNCHRONOUS_IO_NONALERT);
365 if (NT_SUCCESS(Status))
366 {
367 Status = NtDeviceIoControlFile(FileHandle,
368 NULL,
369 NULL,
370 NULL,
371 &Iosb,
372 IOCTL_DISK_GET_DRIVE_GEOMETRY,
373 NULL,
374 0,
375 &DiskGeometry,
376 sizeof(DISK_GEOMETRY));
377 if (NT_SUCCESS(Status))
378 {
379 Status = NtDeviceIoControlFile(FileHandle,
380 NULL,
381 NULL,
382 NULL,
383 &Iosb,
384 IOCTL_SCSI_GET_ADDRESS,
385 NULL,
386 0,
387 &ScsiAddress,
388 sizeof(SCSI_ADDRESS));
389
390 if (DiskGeometry.MediaType == FixedMedia)
391 {
392 DiskSize = DiskGeometry.Cylinders.QuadPart *
393 (ULONGLONG)DiskGeometry.TracksPerCylinder *
394 (ULONGLONG)DiskGeometry.SectorsPerTrack *
395 (ULONGLONG)DiskGeometry.BytesPerSector;
396 #if 0
397 if (DiskSize >= 0x120000000ULL) /* 10 GB */
398 {
399 DiskSize
400 Scale = "GB";
401 }
402 else
403 #endif
404 {
405 DiskSize = (DiskSize + (1 << 19)) >> 20;
406 Scale = "MB";
407 }
408
409 PrintTextXY(8, Line++,
410 "%I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu)",
411 DiskSize,
412 Scale,
413 DiskCount,
414 ScsiAddress.PortNumber,
415 ScsiAddress.PathId,
416 ScsiAddress.TargetId);
417
418 LayoutBuffer = (DRIVE_LAYOUT_INFORMATION*)RtlAllocateHeap(ProcessHeap, 0, 8192);
419
420 Status = NtDeviceIoControlFile(FileHandle,
421 NULL,
422 NULL,
423 NULL,
424 &Iosb,
425 IOCTL_DISK_GET_DRIVE_LAYOUT,
426 NULL,
427 0,
428 LayoutBuffer,
429 8192);
430 if (NT_SUCCESS(Status))
431 {
432 for (i = 0; i < LayoutBuffer->PartitionCount; i++)
433 {
434 if ((LayoutBuffer->PartitionEntry[i].PartitionType != PARTITION_ENTRY_UNUSED) &&
435 !IsContainerPartition(LayoutBuffer->PartitionEntry[i].PartitionType))
436 {
437 if ((LayoutBuffer->PartitionEntry[i].PartitionType == PARTITION_FAT_12) ||
438 (LayoutBuffer->PartitionEntry[i].PartitionType == PARTITION_FAT_16) ||
439 (LayoutBuffer->PartitionEntry[i].PartitionType == PARTITION_HUGE) ||
440 (LayoutBuffer->PartitionEntry[i].PartitionType == PARTITION_XINT13))
441 {
442 PartType = "FAT";
443 }
444 else if ((LayoutBuffer->PartitionEntry[i].PartitionType == PARTITION_FAT32) ||
445 (LayoutBuffer->PartitionEntry[i].PartitionType == PARTITION_FAT32_XINT13))
446 {
447 PartType = "FAT32";
448 }
449 else if (LayoutBuffer->PartitionEntry[i].PartitionType == PARTITION_IFS)
450 {
451 PartType = "NTFS"; /* FIXME: Not quite correct! */
452 }
453 else
454 {
455 PartType = "Unknown";
456 }
457
458 PrintTextXY(10, Line++,
459 "%d: nr: %d type: %x (%s) %I64u MB",
460 i,
461 LayoutBuffer->PartitionEntry[i].PartitionNumber,
462 LayoutBuffer->PartitionEntry[i].PartitionType,
463 PartType,
464 (LayoutBuffer->PartitionEntry[i].PartitionLength.QuadPart + (1 << 19)) >>20);
465
466
467
468 }
469 }
470 }
471
472 RtlFreeHeap(ProcessHeap, 0, LayoutBuffer);
473 }
474 }
475 else
476 {
477 PrintTextXY(8, Line++,
478 "Harddisk %lu: Failed to retrieve drive geometry (Status %lx)",
479 DiskCount, Status);
480 }
481
482 NtClose(FileHandle);
483 Line++;
484 }
485 else
486 {
487 PrintTextXY(8, Line++,
488 "Harddisk %lu: Failed to open (Status %lx)",
489 DiskCount, Status);
490 }
491 }
492
493 SetStatusText(" ENTER = Continue F3 = Quit");
494
495 while(TRUE)
496 {
497 ConInKey(Ir);
498
499 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
500 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3))
501 {
502 if (ConfirmQuit(Ir) == TRUE)
503 return(QUIT_PAGE);
504 break;
505 }
506 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)
507 {
508 return(SELECT_FILE_SYSTEM_PAGE);
509 }
510 }
511
512 return(CHOOSE_PARTITION_PAGE);
513 }
514
515
516 static ULONG
517 SelectFileSystemPage(PINPUT_RECORD Ir)
518 {
519
520 SetTextXY(6, 8, "Select a file system");
521
522 SetTextXY(6, 10, "At present, ReactOS can not be installed on unformatted partitions.");
523
524
525 SetStatusText(" ENTER = Continue F3 = Quit");
526
527 while(TRUE)
528 {
529 ConInKey(Ir);
530
531 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
532 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3))
533 {
534 if (ConfirmQuit(Ir) == TRUE)
535 return(QUIT_PAGE);
536 break;
537 }
538 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)
539 {
540 return(CHECK_FILE_SYSTEM_PAGE);
541 }
542 }
543
544 return(SELECT_FILE_SYSTEM_PAGE);
545 }
546
547
548 static ULONG
549 CheckFileSystemPage(PINPUT_RECORD Ir)
550 {
551
552 SetTextXY(6, 8, "Check file system");
553
554 SetTextXY(6, 10, "At present, ReactOS can not check file systems.");
555
556
557 SetStatusText(" ENTER = Continue F3 = Quit");
558
559 while(TRUE)
560 {
561 ConInKey(Ir);
562
563 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
564 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3))
565 {
566 if (ConfirmQuit(Ir) == TRUE)
567 return(QUIT_PAGE);
568 break;
569 }
570 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)
571 {
572 return(INSTALL_DIRECTORY_PAGE);
573 }
574 }
575
576 return(CHECK_FILE_SYSTEM_PAGE);
577 }
578
579
580 static ULONG
581 InstallDirectoryPage(PINPUT_RECORD Ir)
582 {
583
584 SetTextXY(6, 8, "Enter the install directory");
585
586 SetTextXY(6, 12, "Install directory: \reactos");
587
588
589 SetStatusText(" ENTER = Continue F3 = Quit");
590
591 while(TRUE)
592 {
593 ConInKey(Ir);
594
595 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
596 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3))
597 {
598 if (ConfirmQuit(Ir) == TRUE)
599 return(QUIT_PAGE);
600 break;
601 }
602 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)
603 {
604 return(PREPARE_COPY_PAGE);
605 }
606 }
607
608 return(INSTALL_DIRECTORY_PAGE);
609 }
610
611
612 static ULONG
613 PrepareCopyPage(PINPUT_RECORD Ir)
614 {
615
616 SetTextXY(6, 8, "Preparing to copy files");
617
618
619 SetTextXY(6, 12, "Build file copy list");
620
621 SetTextXY(6, 14, "Create directories");
622
623
624 SetStatusText(" ENTER = Continue F3 = Quit");
625
626 while(TRUE)
627 {
628 ConInKey(Ir);
629
630 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
631 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3))
632 {
633 if (ConfirmQuit(Ir) == TRUE)
634 return(QUIT_PAGE);
635 break;
636 }
637 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)
638 {
639 return(FILE_COPY_PAGE);
640 }
641 }
642
643 return(PREPARE_COPY_PAGE);
644 }
645
646
647 static ULONG
648 FileCopyPage(PINPUT_RECORD Ir)
649 {
650
651 SetTextXY(6, 8, "Copying files");
652
653
654 SetStatusText(" ENTER = Continue F3 = Quit");
655
656 while(TRUE)
657 {
658 ConInKey(Ir);
659
660 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
661 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3))
662 {
663 if (ConfirmQuit(Ir) == TRUE)
664 return(QUIT_PAGE);
665 break;
666 }
667 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)
668 {
669 return(INIT_SYSTEM_PAGE);
670 }
671 }
672
673 return(FILE_COPY_PAGE);
674 }
675
676
677 static ULONG
678 InitSystemPage(PINPUT_RECORD Ir)
679 {
680
681 SetTextXY(6, 8, "Initializing system settings");
682
683
684 SetTextXY(6, 12, "Create registry hives");
685
686 SetTextXY(6, 14, "Update registry hives");
687
688 SetTextXY(6, 16, "Install/update boot manager");
689
690
691 SetStatusText(" ENTER = Continue F3 = Quit");
692
693 while(TRUE)
694 {
695 ConInKey(Ir);
696
697 if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
698 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3))
699 {
700 if (ConfirmQuit(Ir) == TRUE)
701 return(QUIT_PAGE);
702 break;
703 }
704 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)
705 {
706 return(SUCCESS_PAGE);
707 }
708 }
709
710 return(INIT_SYSTEM_PAGE);
711 }
712
713
714 static ULONG
715 QuitPage(PINPUT_RECORD Ir)
716 {
717 SetTextXY(10, 6, "ReactOS is not completely installed");
718
719 SetTextXY(10, 8, "Remove floppy disk from Drive A: and");
720 SetTextXY(10, 9, "all CD-ROMs from CD-Drive.");
721
722 SetTextXY(10, 11, "Press ENTER to reboot your computer.");
723
724 SetStatusText(" ENTER = Reboot computer");
725
726 while(TRUE)
727 {
728 ConInKey(Ir);
729
730 if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)
731 {
732 return(REBOOT_PAGE);
733 }
734 }
735 }
736
737
738 static ULONG
739 SuccessPage(PINPUT_RECORD Ir)
740 {
741 SetTextXY(10, 6, "The basic components of ReactOS have been installed successfully.");
742
743 SetTextXY(10, 8, "Remove floppy disk from Drive A: and");
744 SetTextXY(10, 9, "all CD-ROMs from CD-Drive.");
745
746 SetTextXY(10, 11, "Press ENTER to reboot your computer.");
747
748 SetStatusText(" ENTER = Reboot computer");
749
750 while(TRUE)
751 {
752 ConInKey(Ir);
753
754 if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)
755 {
756 return(REBOOT_PAGE);
757 }
758 }
759 }
760
761
762 VOID
763 NtProcessStartup(PPEB Peb)
764 {
765 NTSTATUS Status;
766 INPUT_RECORD Ir;
767 ULONG Page;
768
769 RtlNormalizeProcessParams(Peb->ProcessParameters);
770
771 ProcessHeap = Peb->ProcessHeap;
772
773 Status = AllocConsole();
774 if (!NT_SUCCESS(Status))
775 {
776 PrintString("Console initialization failed! (Status %lx)\n", Status);
777
778 /* Raise a hard error (crash the system/BSOD) */
779 NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED,
780 0,0,0,0,0);
781 }
782
783 Page = INTRO_PAGE;
784 while (Page != REBOOT_PAGE)
785 {
786 ClearScreen();
787
788 SetTextXY(4, 3, " ReactOS 0.0.20 Setup ");
789 SetTextXY(4, 4, "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD");
790
791 switch (Page)
792 {
793 case INTRO_PAGE:
794 Page = IntroPage(&Ir);
795 break;
796
797 case INSTALL_INTRO_PAGE:
798 Page = InstallIntroPage(&Ir);
799 break;
800
801 #if 0
802 case OEM_DRIVER_PAGE:
803 Page = OemDriverPage(&Ir);
804 break;
805 #endif
806
807 #if 0
808 case DEVICE_SETTINGS_PAGE:
809 #endif
810
811 case CHOOSE_PARTITION_PAGE:
812 Page = ChoosePartitionPage(&Ir);
813 break;
814
815 case SELECT_FILE_SYSTEM_PAGE:
816 Page = SelectFileSystemPage(&Ir);
817 break;
818
819 case CHECK_FILE_SYSTEM_PAGE:
820 Page = CheckFileSystemPage(&Ir);
821 break;
822
823 case INSTALL_DIRECTORY_PAGE:
824 Page = InstallDirectoryPage(&Ir);
825 break;
826
827 case PREPARE_COPY_PAGE:
828 Page = PrepareCopyPage(&Ir);
829 break;
830
831 case FILE_COPY_PAGE:
832 Page = FileCopyPage(&Ir);
833 break;
834
835 case INIT_SYSTEM_PAGE:
836 Page = InitSystemPage(&Ir);
837 break;
838
839
840 case SUCCESS_PAGE:
841 Page = SuccessPage(&Ir);
842 break;
843
844 case QUIT_PAGE:
845 Page = QuitPage(&Ir);
846 break;
847 }
848 }
849
850 /* Reboot */
851 FreeConsole();
852 NtShutdownSystem(ShutdownReboot);
853 }
854
855 /* EOF */