- /* FIXME: show an error dialog */
- //
- // Error dialog should say that we cannot find a suitable
- // system partition and create one on the system. At this point,
- // it may be nice to ask the user whether he wants to continue,
- // or use an external drive as the system drive/partition
- // (e.g. floppy, USB drive, etc...)
- //
- return QUIT_PAGE;
+ /* Find or set the active system partition */
+ CheckActiveSystemPartition(PartitionList);
+ if (PartitionList->SystemPartition == NULL)
+ {
+ /* FIXME: show an error dialog */
+ //
+ // Error dialog should say that we cannot find a suitable
+ // system partition and create one on the system. At this point,
+ // it may be nice to ask the user whether he wants to continue,
+ // or use an external drive as the system drive/partition
+ // (e.g. floppy, USB drive, etc...)
+ //
+ return QUIT_PAGE;
+ }
+
+ /*
+ * If the system partition can be created in some
+ * non-partitioned space, create it now.
+ */
+ if (!PartitionList->SystemPartition->IsPartitioned)
+ {
+ // if (IsUnattendedSetup)
+ {
+ CreatePrimaryPartition(PartitionList,
+ PartitionList->SystemPartition,
+ 0LL, // PartitionList->SystemPartition->SectorCount.QuadPart,
+ TRUE);
+ ASSERT(PartitionList->SystemPartition->IsPartitioned);
+ }
+ // else
+ {
+ }
+ }
+
+ /* Commit all partition changes to all the disks */
+ if (!WritePartitionsToDisk(PartitionList))
+ {
+ DPRINT("WritePartitionsToDisk() failed\n");
+ MUIDisplayError(ERROR_WRITE_PTABLE, Ir, POPUP_WAIT_ENTER);
+ return QUIT_PAGE;
+ }
+
+ /*
+ * In all cases, whether or not we are going to perform a formatting,
+ * we must perform a filesystem check of both the system and the
+ * installation partitions.
+ */
+ PartitionList->CurrentPartition->NeedsCheck = TRUE;
+ if (PartitionList->SystemPartition != PartitionList->CurrentPartition)
+ PartitionList->SystemPartition->NeedsCheck = TRUE;
+
+ /*
+ * In case we just repair an existing installation, or make
+ * an unattended setup without formatting, just go to the
+ * filesystem check step.
+ */
+ if (RepairUpdateFlag)
+ return CHECK_FILE_SYSTEM_PAGE;
+
+ if (IsUnattendedSetup && !USetupData.FormatPartition)
+ return CHECK_FILE_SYSTEM_PAGE;