- Check the number of harddisks and fail if no harddisk is available.

- Updated some texts.
- Disabled debugging messages.

svn path=/trunk/; revision=6203
This commit is contained in:
Eric Kohl 2003-10-01 14:54:21 +00:00
parent 960aa79c36
commit 14faffecc0

View file

@ -398,15 +398,55 @@ ConfirmQuit(PINPUT_RECORD Ir)
static PAGE_NUMBER static PAGE_NUMBER
StartPage(PINPUT_RECORD Ir) StartPage(PINPUT_RECORD Ir)
{ {
SYSTEM_DEVICE_INFORMATION Sdi;
NTSTATUS Status; NTSTATUS Status;
WCHAR FileNameBuffer[MAX_PATH]; WCHAR FileNameBuffer[MAX_PATH];
UNICODE_STRING FileName; UNICODE_STRING FileName;
INFCONTEXT Context; INFCONTEXT Context;
PWCHAR Value; PWCHAR Value;
ULONG ErrorLine; ULONG ErrorLine;
ULONG ReturnSize;
SetStatusText(" Please wait..."); SetStatusText(" Please wait...");
/* Check whether a harddisk is available */
Status = NtQuerySystemInformation (SystemDeviceInformation,
&Sdi,
sizeof(SYSTEM_DEVICE_INFORMATION),
&ReturnSize);
if (!NT_SUCCESS (Status))
{
PrintTextXY(6, 15, "NtQuerySystemInformation() failed (Status 0x%08lx)", Status);
PopupError("Setup could not retrieve system drive information.\n",
"ENTER = Reboot computer");
while(TRUE)
{
ConInKey(Ir);
if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return(QUIT_PAGE);
}
}
}
if (Sdi.NumberOfDisks == 0)
{
PopupError("Setup could not find a harddisk.\n",
"ENTER = Reboot computer");
while(TRUE)
{
ConInKey(Ir);
if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return(QUIT_PAGE);
}
}
}
/* Get the source path and source root path */
Status = GetSourcePaths(&SourcePath, Status = GetSourcePaths(&SourcePath,
&SourceRootPath); &SourceRootPath);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
@ -638,17 +678,19 @@ InstallIntroPage(PINPUT_RECORD Ir)
SetTextXY(6, 8, "ReactOS Setup is in an early development phase. It does not yet"); 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."); SetTextXY(6, 9, "support all the functions of a fully usable setup application.");
SetTextXY(6, 12, "The following functions are missing:"); SetTextXY(6, 12, "The following limitations apply:");
SetTextXY(8, 13, "- Creating and deleting harddisk partitions."); SetTextXY(8, 13, "- Setup can not handle more than one primary partition per disk.");
SetTextXY(8, 14, "- Formatting partitions."); SetTextXY(8, 14, "- Setup can not delete a primary partition from a disk");
SetTextXY(8, 15, "- Support for non-FAT file systems."); SetTextXY(8, 15, " as long as extended partitions exist on this disk.");
SetTextXY(8, 16, "- Checking file systems."); SetTextXY(8, 16, "- Setup can not delete the first extended partition from a disk");
SetTextXY(8, 17, " as long as other extended partitions exist on this disk.");
SetTextXY(8, 18, "- Setup supports FAT file systems only.");
SetTextXY(8, 19, "- File system checks are not implemented yet.");
SetTextXY(8, 23, "\x07 Press ENTER to install ReactOS.");
SetTextXY(8, 21, "\x07 Press ENTER to install ReactOS."); SetTextXY(8, 25, "\x07 Press F3 to quit without installing ReactOS.");
SetTextXY(8, 23, "\x07 Press F3 to quit without installing ReactOS.");
SetStatusText(" ENTER = Continue F3 = Quit"); SetStatusText(" ENTER = Continue F3 = Quit");
@ -1538,10 +1580,10 @@ FormatPartitionPage (PINPUT_RECORD Ir)
PLIST_ENTRY Entry; PLIST_ENTRY Entry;
NTSTATUS Status; NTSTATUS Status;
//#ifndef NDEBUG #ifndef NDEBUG
ULONG Line; ULONG Line;
ULONG i; ULONG i;
//#endif #endif
SetTextXY(6, 8, "Format partition"); SetTextXY(6, 8, "Format partition");
@ -1636,7 +1678,7 @@ FormatPartitionPage (PINPUT_RECORD Ir)
CheckActiveBootPartition (PartitionList); CheckActiveBootPartition (PartitionList);
//#ifndef NDEBUG #ifndef NDEBUG
PrintTextXY (6, 12, PrintTextXY (6, 12,
"Disk: %I64u Cylinder: %I64u Track: %I64u", "Disk: %I64u Cylinder: %I64u Track: %I64u",
DiskEntry->DiskSize, DiskEntry->DiskSize,
@ -1676,7 +1718,7 @@ FormatPartitionPage (PINPUT_RECORD Ir)
/* Restore the old entry */ /* Restore the old entry */
PartEntry = PartitionList->CurrentPartition; PartEntry = PartitionList->CurrentPartition;
//#endif #endif
if (WritePartitionsToDisk (PartitionList) == FALSE) if (WritePartitionsToDisk (PartitionList) == FALSE)
{ {
@ -1996,6 +2038,7 @@ PrepareCopyPageInfFile(HINF InfFile, PWCHAR SourceCabinet, PINPUT_RECORD Ir)
PWCHAR FileKeyValue; PWCHAR FileKeyValue;
PWCHAR DirKeyName; PWCHAR DirKeyName;
PWCHAR DirKeyValue; PWCHAR DirKeyValue;
PWCHAR TargetFileName;
/* Search for the 'SourceFiles' section */ /* Search for the 'SourceFiles' section */
if (!InfFindFirstLine (InfFile, L"SourceFiles", NULL, &FilesContext)) if (!InfFindFirstLine (InfFile, L"SourceFiles", NULL, &FilesContext))
@ -2021,12 +2064,18 @@ PrepareCopyPageInfFile(HINF InfFile, PWCHAR SourceCabinet, PINPUT_RECORD Ir)
*/ */
do do
{ {
/* Get source file name and target directory id */
if (!InfGetData (&FilesContext, &FileKeyName, &FileKeyValue)) if (!InfGetData (&FilesContext, &FileKeyName, &FileKeyValue))
{ {
DPRINT("break\n"); /* FIXME: Handle error! */
DPRINT1("InfGetData() failed\n");
break; break;
} }
/* Get optional target file name */
if (!InfGetDataField (&FilesContext, 2, &TargetFileName))
TargetFileName = NULL;
DPRINT ("FileKeyName: '%S' FileKeyValue: '%S'\n", FileKeyName, FileKeyValue); DPRINT ("FileKeyName: '%S' FileKeyValue: '%S'\n", FileKeyName, FileKeyValue);
/* Lookup target directory */ /* Lookup target directory */
@ -2050,7 +2099,7 @@ PrepareCopyPageInfFile(HINF InfFile, PWCHAR SourceCabinet, PINPUT_RECORD Ir)
L"\\reactos", L"\\reactos",
FileKeyName, FileKeyName,
DirKeyValue, DirKeyValue,
NULL)) TargetFileName))
{ {
/* FIXME: Handle error! */ /* FIXME: Handle error! */
DPRINT1("SetupQueueCopy() failed\n"); DPRINT1("SetupQueueCopy() failed\n");
@ -2280,7 +2329,8 @@ PrepareCopyPage(PINPUT_RECORD Ir)
{ {
DPRINT("Cannot open cabinet: %S.\n", CabinetGetCabinetName()); DPRINT("Cannot open cabinet: %S.\n", CabinetGetCabinetName());
PopupError("Cabinet not found.\n", "ENTER = Reboot computer"); PopupError("Cabinet not found.\n",
"ENTER = Reboot computer");
while(TRUE) while(TRUE)
{ {
@ -2547,6 +2597,7 @@ BootLoaderPage(PINPUT_RECORD Ir)
} }
} }
} }
if (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == 0x0A) if (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == 0x0A)
{ {
/* OS/2 boot manager partition */ /* OS/2 boot manager partition */