- Re-enable the partition size check and display a warning if the install partition is too small.
- Update the required install partition size to 550MB.

svn path=/trunk/; revision=65847
This commit is contained in:
Eric Kohl 2014-12-27 12:33:59 +00:00
parent 9eba5bef02
commit 27ff04d62b
27 changed files with 123 additions and 84 deletions

View file

@ -66,7 +66,7 @@ typedef enum
ERROR_UPDATE_LOCALESETTINGS, ERROR_UPDATE_LOCALESETTINGS,
ERROR_ADDING_KBLAYOUTS, ERROR_ADDING_KBLAYOUTS,
ERROR_UPDATE_GEOID, ERROR_UPDATE_GEOID,
ERROR_INSUFFICIENT_DISKSPACE, ERROR_INSUFFICIENT_PARTITION_SIZE,
ERROR_PARTITION_TABLE_FULL, ERROR_PARTITION_TABLE_FULL,
ERROR_ONLY_ONE_EXTENDED, ERROR_ONLY_ONE_EXTENDED,

View file

@ -1425,28 +1425,18 @@ LayoutSettingsPage(PINPUT_RECORD Ir)
} }
#if 0
static BOOL static BOOL
IsDiskSizeValid(PPARTENTRY PartEntry) IsDiskSizeValid(PPARTENTRY PartEntry)
{ {
ULONGLONG m1, m2; ULONGLONG size;
/* check for unpartitioned space */ size = PartEntry->SectorCount.QuadPart * PartEntry->DiskEntry->BytesPerSector;
m1 = PartEntry->UnpartitionedLength; size = (size + 524288) / 1048576; /* in MBytes */
m1 = (m1 + (1 << 19)) >> 20; /* in MBytes (rounded) */
if( m1 > RequiredPartitionDiskSpace) if (size < RequiredPartitionDiskSpace)
{
return TRUE;
}
/* check for partitioned space */
m2 = PartEntry->PartInfo[0].PartitionLength.QuadPart;
m2 = (m2 + (1 << 19)) >> 20; /* in MBytes (rounded) */
if (m2 < RequiredPartitionDiskSpace)
{ {
/* partition is too small so ask for another partion */ /* partition is too small so ask for another partion */
DPRINT1("Partition is too small(unpartitioned: %I64u MB, partitioned: %I64u MB), required disk space is %lu MB\n", m1, m2, RequiredPartitionDiskSpace); DPRINT1("Partition is too small (size: %I64u MB), required disk space is %lu MB\n", size, RequiredPartitionDiskSpace);
return FALSE; return FALSE;
} }
else else
@ -1454,7 +1444,6 @@ IsDiskSizeValid(PPARTENTRY PartEntry)
return TRUE; return TRUE;
} }
} }
#endif
static PAGE_NUMBER static PAGE_NUMBER
@ -1513,17 +1502,17 @@ SelectPartitionPage(PINPUT_RECORD Ir)
{ {
if (AutoPartition) if (AutoPartition)
{ {
#if 0
if (!IsDiskSizeValid(PartitionList->CurrentPartition))
{
MUIDisplayError(ERROR_INSUFFICIENT_DISKSPACE, Ir, POPUP_WAIT_ANY_KEY);
return SELECT_PARTITION_PAGE; /* let the user select another partition */
}
#endif
CreatePrimaryPartition(PartitionList, CreatePrimaryPartition(PartitionList,
PartitionList->CurrentPartition->SectorCount.QuadPart, PartitionList->CurrentPartition->SectorCount.QuadPart,
TRUE); TRUE);
if (!IsDiskSizeValid(PartitionList->CurrentPartition))
{
MUIDisplayError(ERROR_INSUFFICIENT_PARTITION_SIZE, Ir, POPUP_WAIT_ANY_KEY,
RequiredPartitionDiskSpace);
return SELECT_PARTITION_PAGE; /* let the user select another partition */
}
DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter; DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter;
return SELECT_FILE_SYSTEM_PAGE; return SELECT_FILE_SYSTEM_PAGE;
@ -1531,13 +1520,13 @@ SelectPartitionPage(PINPUT_RECORD Ir)
} }
else else
{ {
#if 0
if (!IsDiskSizeValid(PartitionList->CurrentPartition)) if (!IsDiskSizeValid(PartitionList->CurrentPartition))
{ {
MUIDisplayError(ERROR_INSUFFICIENT_DISKSPACE, Ir, POPUP_WAIT_ANY_KEY); MUIDisplayError(ERROR_INSUFFICIENT_PARTITION_SIZE, Ir, POPUP_WAIT_ANY_KEY,
RequiredPartitionDiskSpace);
return SELECT_PARTITION_PAGE; /* let the user select another partition */ return SELECT_PARTITION_PAGE; /* let the user select another partition */
} }
#endif
DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter; DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter;
return SELECT_FILE_SYSTEM_PAGE; return SELECT_FILE_SYSTEM_PAGE;
@ -1609,13 +1598,6 @@ SelectPartitionPage(PINPUT_RECORD Ir)
} }
else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_RETURN) /* ENTER */ else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_RETURN) /* ENTER */
{ {
#if 0
if (!IsDiskSizeValid(PartitionList->CurrentPartition))
{
MUIDisplayError(ERROR_INSUFFICIENT_DISKSPACE, Ir, POPUP_WAIT_ANY_KEY);
return SELECT_PARTITION_PAGE; /* let the user select another partition */
}
#endif
if (IsContainerPartition(PartitionList->CurrentPartition->PartitionType)) if (IsContainerPartition(PartitionList->CurrentPartition->PartitionType))
continue; //return SELECT_PARTITION_PAGE; continue; //return SELECT_PARTITION_PAGE;
@ -1627,6 +1609,13 @@ SelectPartitionPage(PINPUT_RECORD Ir)
TRUE); TRUE);
} }
if (!IsDiskSizeValid(PartitionList->CurrentPartition))
{
MUIDisplayError(ERROR_INSUFFICIENT_PARTITION_SIZE, Ir, POPUP_WAIT_ANY_KEY,
RequiredPartitionDiskSpace);
return SELECT_PARTITION_PAGE; /* let the user select another partition */
}
DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter; DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter;
return SELECT_FILE_SYSTEM_PAGE; return SELECT_FILE_SYSTEM_PAGE;

View file

@ -1506,8 +1506,10 @@ MUI_ERROR bgBGErrorEntries[] =
"ENTER = <20>१ ¯ã᪠­¥ ­  ª®¬¯îâêà " "ENTER = <20>१ ¯ã᪠­¥ ­  ª®¬¯îâêà "
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"<EFBFBD> 豆﹤<E8B186>剁 歹<><> 亢摵罱聬陋 屣恣恕陋 能桑瘔<E6A191>.\n" "The selected partition is not large enough to install ReactOS.\n"
"The install partition must have a size of at least %lu MB.\n"
"\n"
" * <20> â¨á­¥â¥ ª« ¢¨è, §  ¤  ¯à®¤ê«¦¨â¥.", " * <20> â¨á­¥â¥ ª« ¢¨è, §  ¤  ¯à®¤ê«¦¨â¥.",
NULL NULL
}, },

View file

@ -1493,8 +1493,10 @@ MUI_ERROR bnBDErrorEntries[] =
"ENTER = Reboot computer" "ENTER = Reboot computer"
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"Not enough free space in the selected partition.\n" "The selected partition is not large enough to install ReactOS.\n"
"The install partition must have a size of at least %lu MB.\n"
"\n"
" * Press any key to continue.", " * Press any key to continue.",
NULL NULL
}, },

View file

@ -1501,8 +1501,10 @@ MUI_ERROR csCZErrorEntries[] =
"ENTER = Restartovat poŸ¡taŸ" "ENTER = Restartovat poŸ¡taŸ"
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"Na zvolenm odd¡lu nen¡ dost volnho m¡sta.\n" "The selected partition is not large enough to install ReactOS.\n"
"The install partition must have a size of at least %lu MB.\n"
"\n"
" * PokraŸujte stisknut¡m libovoln kl vesy.", " * PokraŸujte stisknut¡m libovoln kl vesy.",
NULL NULL
}, },

View file

@ -1497,9 +1497,10 @@ MUI_ERROR deDEErrorEntries[] =
"EINGABETASTE = Computer neu starten" "EINGABETASTE = Computer neu starten"
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"Es ist nicht gen<65>gend Speicherplatz auf der\n" "Die gew„hlten Partition ist nicht groá genug, um ReactOS zu installieren.\n"
"gew„hlten Partition vorhanden.\n" "Die Installationspartition muss mindestens %lu MB groá sein.\n"
"\n"
" * Eine beliebige Taste zum Fortsetzen dr<64>cken.", " * Eine beliebige Taste zum Fortsetzen dr<64>cken.",
NULL NULL
}, },

View file

@ -1493,8 +1493,10 @@ MUI_ERROR enUSErrorEntries[] =
"ENTER = Reboot computer" "ENTER = Reboot computer"
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"Not enough free space in the selected partition.\n" "The selected partition is not large enough to install ReactOS.\n"
"The install partition must have a size of at least %lu MB.\n"
"\n"
" * Press any key to continue.", " * Press any key to continue.",
NULL NULL
}, },

View file

@ -1501,8 +1501,10 @@ MUI_ERROR esESErrorEntries[] =
"ENTER = Reiniciar el equipo" "ENTER = Reiniciar el equipo"
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"No hay suficiente espacio disponible en la partici¢n seleccionada.\n" "The selected partition is not large enough to install ReactOS.\n"
"The install partition must have a size of at least %lu MB.\n"
"\n"
" * Presione una tecla para continuar.", " * Presione una tecla para continuar.",
NULL NULL
}, },

View file

@ -1491,8 +1491,10 @@ MUI_ERROR etEEErrorEntries[] =
"ENTER = Taask„ivita arvuti" "ENTER = Taask„ivita arvuti"
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"Valitud partitsioonil pole piisavalt ruumi.\n" "The selected partition is not large enough to install ReactOS.\n"
"The install partition must have a size of at least %lu MB.\n"
"\n"
" * Vajuta suvalist klahvi, et j„tkata.", " * Vajuta suvalist klahvi, et j„tkata.",
NULL NULL
}, },

View file

@ -1506,8 +1506,10 @@ MUI_ERROR frFRErrorEntries[] =
"ENTR<EFBFBD>E = Redmarrer l'ordinateur" "ENTR<EFBFBD>E = Redmarrer l'ordinateur"
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"Pas assez d'espace libre dans la partition slectionne.\n" "The selected partition is not large enough to install ReactOS.\n"
"The install partition must have a size of at least %lu MB.\n"
"\n"
" * Appuyer sur une touche pour continuer.", " * Appuyer sur une touche pour continuer.",
NULL NULL
}, },

View file

@ -1494,8 +1494,10 @@ MUI_ERROR heILErrorEntries[] =
"ENTER = Reboot computer" "ENTER = Reboot computer"
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"Not enough free space in the selected partition.\n" "The selected partition is not large enough to install ReactOS.\n"
"The install partition must have a size of at least %lu MB.\n"
"\n"
" * Press any key to continue.", " * Press any key to continue.",
NULL NULL
}, },

View file

@ -1495,8 +1495,10 @@ MUI_ERROR itITErrorEntries[] =
"INVIO = Riavviare il computer" "INVIO = Riavviare il computer"
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"Lo spazio disponibile nella partizione selezionata Š insufficiente.\n" "The selected partition is not large enough to install ReactOS.\n"
"The install partition must have a size of at least %lu MB.\n"
"\n"
" * Premere un tasto qualsiasi per continuare.", " * Premere un tasto qualsiasi per continuare.",
NULL NULL
}, },

View file

@ -1495,8 +1495,10 @@ MUI_ERROR jaJPErrorEntries[] =
"ENTER = ºÝËß­°ÀÉ »²·ÄÞ³" "ENTER = ºÝËß­°ÀÉ »²·ÄÞ³"
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"Not enough free space in the selected partition.\n" "The selected partition is not large enough to install ReactOS.\n"
"The install partition must have a size of at least %lu MB.\n"
"\n"
" * Press any key to continue.", " * Press any key to continue.",
NULL NULL
}, },

View file

@ -1503,8 +1503,10 @@ MUI_ERROR ltLTErrorEntries[] =
"ENTER = Reboot computer" "ENTER = Reboot computer"
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"Not enough free space in the selected partition.\n" "The selected partition is not large enough to install ReactOS.\n"
"The install partition must have a size of at least %lu MB.\n"
"\n"
" * Press any key to continue.", " * Press any key to continue.",
NULL NULL
}, },

View file

@ -1539,8 +1539,10 @@ MUI_ERROR nlNLErrorEntries[] =
"ENTER = Computer opnieuw opstarten" "ENTER = Computer opnieuw opstarten"
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"Onvoldoende vrije ruimte in de geselecteerde partitie.\n" "The selected partition is not large enough to install ReactOS.\n"
"The install partition must have a size of at least %lu MB.\n"
"\n"
" * Druk op een toets om door te gaan.", " * Druk op een toets om door te gaan.",
NULL NULL
}, },

View file

@ -1503,8 +1503,10 @@ MUI_ERROR plPLErrorEntries[] =
"ENTER = Restart komputera" "ENTER = Restart komputera"
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"Brak wystarczajĽcej wolnej przestrzeni w wybranej partycji.\n" "The selected partition is not large enough to install ReactOS.\n"
"The install partition must have a size of at least %lu MB.\n"
"\n"
" * Naci˜nij dowolny klawisz, aby kontynuowa†.", " * Naci˜nij dowolny klawisz, aby kontynuowa†.",
NULL NULL
}, },

View file

@ -1531,8 +1531,10 @@ MUI_ERROR ptBRErrorEntries[] =
"ENTER=Reiniciar" "ENTER=Reiniciar"
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"NÆo h  espa‡o suficiente na parti‡Æo selecionada.\n" "The selected partition is not large enough to install ReactOS.\n"
"The install partition must have a size of at least %lu MB.\n"
"\n"
" * Pressione qualquer tecla para continuar.", " * Pressione qualquer tecla para continuar.",
NULL NULL
}, },

View file

@ -1570,9 +1570,10 @@ MUI_ERROR roROErrorEntries[] =
"ENTER = Repornire calculator" "ENTER = Repornire calculator"
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"Pe partiîia selectatÇ nu existÇ suficient\n" "The selected partition is not large enough to install ReactOS.\n"
"spaîiu liber." "The install partition must have a size of at least %lu MB.\n"
"\n"
" * Tastaîi pentru a continua.", " * Tastaîi pentru a continua.",
NULL NULL
}, },

View file

@ -1495,8 +1495,10 @@ MUI_ERROR ruRUErrorEntries[] =
"ENTER = Reboot computer" "ENTER = Reboot computer"
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"Not enough free space in the selected partition.\n" "The selected partition is not large enough to install ReactOS.\n"
"The install partition must have a size of at least %lu MB.\n"
"\n"
" * Press any key to continue.", " * Press any key to continue.",
NULL NULL
}, },

View file

@ -1505,8 +1505,10 @@ MUI_ERROR skSKErrorEntries[] =
"ENTER = Reçtart poŸ¡taŸa" "ENTER = Reçtart poŸ¡taŸa"
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"Na zvolenej partˇcii nie je dostatok vonho miesta.\n" "The selected partition is not large enough to install ReactOS.\n"
"The install partition must have a size of at least %lu MB.\n"
"\n"
" * PokraŸujte stlaŸen¡m ubovonho kl vesu.", " * PokraŸujte stlaŸen¡m ubovonho kl vesu.",
NULL NULL
}, },

View file

@ -1498,8 +1498,10 @@ MUI_ERROR sqALErrorEntries[] =
"ENTER = Ristarto kompjuterin" "ENTER = Ristarto kompjuterin"
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"Jo mjaft hapesir‰ e lir‰ n‰ particionin e p‰rzgjedhur.\n" "The selected partition is not large enough to install ReactOS.\n"
"The install partition must have a size of at least %lu MB.\n"
"\n"
" * Shtypni nj‰ tast cfar‰do p‰r t‰ vazhduar.", " * Shtypni nj‰ tast cfar‰do p‰r t‰ vazhduar.",
NULL NULL
}, },

View file

@ -1501,8 +1501,10 @@ MUI_ERROR svSEErrorEntries[] =
"ENTER = Starta om datorn" "ENTER = Starta om datorn"
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"Inte tillr„ckligt mycket fritt utrymme p† den valda partitionen.\n" "The selected partition is not large enough to install ReactOS.\n"
"The install partition must have a size of at least %lu MB.\n"
"\n"
" * Tryck valfri tangent f”r att forts„tta.", " * Tryck valfri tangent f”r att forts„tta.",
NULL NULL
}, },

View file

@ -1481,8 +1481,10 @@ MUI_ERROR trTRErrorEntries[] =
"GiriŸ = Bilgisayar<61> Yeniden BaŸlat" "GiriŸ = Bilgisayar<61> Yeniden BaŸlat"
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"Se‡ili b”l<E2809D>mde yeterli boŸ alan yok.\n" "The selected partition is not large enough to install ReactOS.\n"
"The install partition must have a size of at least %lu MB.\n"
"\n"
" * S<>rd<72>rmek i‡in bir d<>§meye bas<61>n<EFBFBD>z.", " * S<>rd<72>rmek i‡in bir d<>§meye bas<61>n<EFBFBD>z.",
NULL NULL
}, },

View file

@ -1501,8 +1501,10 @@ MUI_ERROR ukUAErrorEntries[] =
"ENTER = <20>¥à¥§ ¢ ­â ¦¨â¨ ª®¬¯'îâ¥à" "ENTER = <20>¥à¥§ ¢ ­â ¦¨â¨ ª®¬¯'îâ¥à"
}, },
{ {
//ERROR_INSUFFICIENT_DISKSPACE, //ERROR_INSUFFICIENT_PARTITION_SIZE,
"<EFBFBD>¥¤®áâ â­ì® ¢i«ì­®£® ¬iáæï ­  ®¡à ­®¬ã à®§¤i«i.\n" "The selected partition is not large enough to install ReactOS.\n"
"The install partition must have a size of at least %lu MB.\n"
"\n"
" * <20> â¨á­iâì ¡ã¤ì-ïªã ª« ¢ièã ¤«ï ¯à®¤®¢¦¥­­ï.", " * <20> â¨á­iâì ¡ã¤ì-ïªã ª« ¢ièã ¤«ï ¯à®¤®¢¦¥­­ï.",
NULL NULL
}, },

View file

@ -213,9 +213,12 @@ VOID
MUIDisplayError( MUIDisplayError(
IN ULONG ErrorNum, IN ULONG ErrorNum,
OUT PINPUT_RECORD Ir, OUT PINPUT_RECORD Ir,
IN ULONG WaitEvent) IN ULONG WaitEvent,
...)
{ {
const MUI_ERROR * entry; const MUI_ERROR * entry;
CHAR Buffer[2048];
va_list ap;
if (ErrorNum >= ERROR_LAST_ERROR_CODE) if (ErrorNum >= ERROR_LAST_ERROR_CODE)
{ {
@ -237,7 +240,11 @@ MUIDisplayError(
return; return;
} }
PopupError(entry[ErrorNum].ErrorText, va_start(ap, WaitEvent);
vsprintf(Buffer, entry[ErrorNum].ErrorText, ap);
va_end(ap);
PopupError(Buffer,
entry[ErrorNum].ErrorStatus, entry[ErrorNum].ErrorStatus,
Ir, Ir,
WaitEvent); WaitEvent);

View file

@ -69,7 +69,8 @@ VOID
MUIDisplayError( MUIDisplayError(
ULONG ErrorNum, ULONG ErrorNum,
PINPUT_RECORD Ir, PINPUT_RECORD Ir,
ULONG WaitEvent); ULONG WaitEvent,
...);
LPCWSTR LPCWSTR
MUIDefaultKeyboardLayout(VOID); MUIDefaultKeyboardLayout(VOID);

View file

@ -13,7 +13,7 @@ Signature = "$ReactOS$"
[DiskSpaceRequirements] [DiskSpaceRequirements]
; Required free system partition disk space in MB ; Required free system partition disk space in MB
FreeSysPartDiskSpace=350 FreeSysPartDiskSpace=550
[SourceDisksFiles] [SourceDisksFiles]
acpi.sys=,,,,,,,,,,,,4 acpi.sys=,,,,,,,,,,,,4